From 279382a7b218b9d1b310613088b3fe1b5ad971d8 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Thu, 10 Sep 2020 15:45:26 +0200 Subject: [PATCH] Clear adjustment for the preload value --- editor/src/editor/Editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/src/editor/Editor.cpp b/editor/src/editor/Editor.cpp index 35772396..1d7bc7b4 100644 --- a/editor/src/editor/Editor.cpp +++ b/editor/src/editor/Editor.cpp @@ -565,14 +565,14 @@ void Editor::Impl::createFrameContents() for (int log2value = 10; log2value <= 16; ++log2value) { int value = 1 << log2value; char text[256]; - sprintf(text, "%d kB", value / 1024 * 4); + sprintf(text, "%lu kB", value / 1024 * sizeof(float)); text[sizeof(text) - 1] = '\0'; preloadSizeSlider_->addEntry(text, value); } preloadSizeSlider_->setValueToStringFunction2( [](float value, std::string& result, CParamDisplay*) -> bool { - result = std::to_string(static_cast(std::round(value * (1.0 / 1024 * 4)))) + " kB"; + result = std::to_string(static_cast(std::round(value * (1.0 / 1024 * sizeof(float))))) + " kB"; return true; });