Skip to content

Commit

Permalink
incorrect range value with min value and step
Browse files Browse the repository at this point in the history
If the minimum value and the steps are greater than 0, the value will not be calculated correctly.

Co-Authored-By: Astral-Sheep <[email protected]>
  • Loading branch information
phnix-dev and Astral-Sheep committed Aug 27, 2022
1 parent 09086b0 commit fe1f844
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scene/gui/range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void Range::Shared::emit_changed(const char *p_what) {

void Range::set_value(double p_val) {
if (shared->step > 0) {
p_val = Math::round(p_val / shared->step) * shared->step;
p_val = Math::round((p_val - shared->min) / shared->step) * shared->step + shared->min;
}

if (_rounded_values) {
Expand Down

0 comments on commit fe1f844

Please sign in to comment.