Просмотр исходного кода

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.

Diego Prado Gesto 6 лет назад
Родитель
Сommit
ce7d2c36d0
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      plugins/SimulationView/SimulationSliderLabel.qml

+ 1 - 1
plugins/SimulationView/SimulationSliderLabel.qml

@@ -48,7 +48,7 @@ UM.PointingRectangle {
             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
         horizontalAlignment: TextInput.AlignRight