From 4d74f012fe2786e395ef5e6fbf43a1e13e023eda Mon Sep 17 00:00:00 2001 From: Malkierian Date: Thu, 14 Nov 2024 23:47:44 -0700 Subject: [PATCH] Stop ClampFloat calls in SliderFloat to test issues for a few with sliders jumping from 100 to 0. --- mm/2s2h/BenGui/UIWidgets.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/2s2h/BenGui/UIWidgets.cpp b/mm/2s2h/BenGui/UIWidgets.cpp index 632aac6b0..f40b14bdb 100644 --- a/mm/2s2h/BenGui/UIWidgets.cpp +++ b/mm/2s2h/BenGui/UIWidgets.cpp @@ -455,7 +455,7 @@ bool SliderFloat(const char* label, float* value, float min, float max, const Fl if (options.showButtons) { if (Button("-", { .color = options.color, .size = Sizes::Inline }) && *value > min) { *value -= options.step; - ClampFloat(value, min, max, options.step); + //ClampFloat(value, min, max, options.step); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); dirty = true; } @@ -467,7 +467,7 @@ bool SliderFloat(const char* label, float* value, float min, float max, const Fl if (ImGui::SliderScalar(invisibleLabel, ImGuiDataType_Float, &valueToDisplay, &minToDisplay, &maxToDisplay, options.format, options.flags)) { *value = options.isPercentage ? valueToDisplay / 100.0f : valueToDisplay; - ClampFloat(value, min, max, options.step); + //ClampFloat(value, min, max, options.step); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); dirty = true; } @@ -476,7 +476,7 @@ bool SliderFloat(const char* label, float* value, float min, float max, const Fl ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); if (Button("+", { .color = options.color, .size = Sizes::Inline }) && *value < max) { *value += options.step; - ClampFloat(value, min, max, options.step); + //ClampFloat(value, min, max, options.step); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); dirty = true; }