Fix the width of the slider label when the number of layers was exactly

10, 100, 1000 and so on.

The calculation was using the maximumValue that is 9 in case we have 10
layers, since we start counting from 0 but showing from 1. Now it uses
maximumValue + 1.
This commit is contained in:
Diego Prado Gesto 2018-11-06 16:15:32 +01:00
parent bca3af16e0
commit ce7d2c36d0

View file

@ -48,7 +48,7 @@ UM.PointingRectangle {
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
width: (maximumValue.toString().length + 1) * 10 * screenScaleFactor width: ((maximumValue + 1).toString().length + 1) * 10 * screenScaleFactor
text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array
horizontalAlignment: TextInput.AlignRight horizontalAlignment: TextInput.AlignRight