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
This commit is contained in:
WerWolv 2024-06-24 23:04:20 +02:00
parent 91a0be2d78
commit c1561c7b6a

View file

@ -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();