Skip to content

Commit

Permalink
Stop ClampFloat calls in SliderFloat to test issues for a few with sl…
Browse files Browse the repository at this point in the history
…iders jumping from 100 to 0.
  • Loading branch information
Malkierian committed Nov 15, 2024
1 parent 4669337 commit 4d74f01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mm/2s2h/BenGui/UIWidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 4d74f01

Please sign in to comment.