Skip to content

Commit

Permalink
impr: Only allow scaling factors between 0.1x and 4.0x with slider
Browse files Browse the repository at this point in the history
The old scaling values can still be entered by ctrl-clicking the slider and entering it manually
  • Loading branch information
WerWolv committed Jun 24, 2024
1 parent 91a0be2 commit c1561c7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/builtin/source/content/settings_entries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit c1561c7

Please sign in to comment.