diff options
author | Määttä Antti <antti.maatta@qt.io> | 2017-11-24 14:04:18 +0200 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2017-11-28 10:39:22 +0000 |
commit | 0a8b07c97d5baab70b62af969cb5ad740428bc8a (patch) | |
tree | 0c4e82dff229a6fa536c28a1ebb7827c0f837d17 | |
parent | d2396c5c9e2ca4247262e93b02713b249055f34c (diff) |
Fix float slider steps
Calculate it based on the range instead of fixed value.
Task-number: QT3DS-559
Change-Id: Ibbfc80bea6907ff484662dfdaceda2bda5beed42
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/Authoring/Studio/Palettes/Action/HandlerPropertyBaseSlider.qml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Authoring/Studio/Palettes/Action/HandlerPropertyBaseSlider.qml b/src/Authoring/Studio/Palettes/Action/HandlerPropertyBaseSlider.qml index 544aa75f..12683806 100644 --- a/src/Authoring/Studio/Palettes/Action/HandlerPropertyBaseSlider.qml +++ b/src/Authoring/Studio/Palettes/Action/HandlerPropertyBaseSlider.qml @@ -101,9 +101,13 @@ Row { from: 0 to: 100 - stepSize: root.intSlider ? 1 : 2 + stepSize: root.intSlider ? 1 : sliderStepFromRange(slider.to, slider.from, 100) snapMode: root.intSlider ? Slider.SnapAlways : Slider.NoSnap + function sliderStepFromRange(top, bottom, steps) { + return ((top - bottom) / steps); + } + onMoved: { if (!rateLimiter.running) { rateLimiter.start(); |