From c1561c7b6a3fc9d7e1ddcf68112e291ad46ff6a7 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 24 Jun 2024 23:04:20 +0200 Subject: [PATCH] impr: Only allow scaling factors between 0.1x and 4.0x with slider The old scaling values can still be entered by ctrl-clicking the slider and entering it manually --- plugins/builtin/source/content/settings_entries.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/settings_entries.cpp b/plugins/builtin/source/content/settings_entries.cpp index fbf4a920b..91a3fd9a1 100644 --- a/plugins/builtin/source/content/settings_entries.cpp +++ b/plugins/builtin/source/content/settings_entries.cpp @@ -177,7 +177,12 @@ namespace hex::plugin::builtin { return "x%.1f"; }(); - bool changed = ImGui::SliderFloat(name.data(), &m_value, 0, 10, format.c_str(), ImGuiSliderFlags_AlwaysClamp); + bool changed = ImGui::SliderFloat(name.data(), &m_value, 0, 4, format.c_str()); + + if (m_value < 0) + m_value = 0; + else if (m_value > 10) + m_value = 10; if (ImHexApi::Fonts::getCustomFontPath().empty() && (u32(m_value * 10) % 10) != 0) { ImGui::SameLine();