From 37fb766f31b5e39885acf76ce38ab929aafb071e Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 21 Feb 2024 09:48:54 -0800 Subject: [PATCH] BaseScrollBar: if step is <= 0.0, use 1.0 as minimum This ensures that the decrement/increment buttons do something, if the step isn't customized --- .../controls/supportClasses/BaseScrollBar.hx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/feathers/controls/supportClasses/BaseScrollBar.hx b/src/feathers/controls/supportClasses/BaseScrollBar.hx index 95a41152..fdf7b2d2 100644 --- a/src/feathers/controls/supportClasses/BaseScrollBar.hx +++ b/src/feathers/controls/supportClasses/BaseScrollBar.hx @@ -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; }