Skip to content

Commit

Permalink
BaseScrollBar: if step is <= 0.0, use 1.0 as minimum
Browse files Browse the repository at this point in the history
This ensures that the decrement/increment buttons do something, if the step isn't customized
  • Loading branch information
joshtynjala committed Feb 21, 2024
1 parent c2f593d commit 37fb766
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/feathers/controls/supportClasses/BaseScrollBar.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1068,13 +1068,21 @@ class BaseScrollBar extends FeathersControl implements IScrollBar {
}

private function decrement():Void {
var newValue = this._value - this._step;
var step = this._step;
if (step <= 0.0) {
step = 1.0;
}
var newValue = this._value - step;
newValue = this.restrictValue(newValue);
this.value = newValue;
}

private function increment():Void {
var newValue = this._value + this._step;
var step = this._step;
if (step <= 0.0) {
step = 1.0;
}
var newValue = this._value + step;
newValue = this.restrictValue(newValue);
this.value = newValue;
}
Expand Down

0 comments on commit 37fb766

Please sign in to comment.