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

Fix rounding errors for garbled text
CURA-4941

Mark 7 лет назад
Родитель
Сommit
8fca183a5e

+ 3 - 3
plugins/SimulationView/SimulationView.qml

@@ -231,7 +231,7 @@ Item
                         width: UM.Theme.getSize("layerview_legend_size").width
                         height: UM.Theme.getSize("layerview_legend_size").height
                         color: model.color
-                        radius: width / 2
+                        radius: Math.floor(width / 2)
                         border.width: UM.Theme.getSize("default_lining").width
                         border.color: UM.Theme.getColor("lining")
                         visible: !viewSettings.show_legend & !viewSettings.show_gradient
@@ -249,7 +249,7 @@ Item
                         anchors.verticalCenter: parent.verticalCenter
                         anchors.left: extrudersModelCheckBox.left;
                         anchors.right: extrudersModelCheckBox.right;
-                        anchors.leftMargin: UM.Theme.getSize("checkbox").width + UM.Theme.getSize("default_margin").width /2
+                        anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.floor(UM.Theme.getSize("default_margin").width/2)
                         anchors.rightMargin: UM.Theme.getSize("default_margin").width * 2
                     }
                 }
@@ -316,7 +316,7 @@ Item
                         anchors.verticalCenter: parent.verticalCenter
                         anchors.left: legendModelCheckBox.left;
                         anchors.right: legendModelCheckBox.right;
-                        anchors.leftMargin: UM.Theme.getSize("checkbox").width + UM.Theme.getSize("default_margin").width /2
+                        anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.floor(UM.Theme.getSize("default_margin").width/2)
                         anchors.rightMargin: UM.Theme.getSize("default_margin").width * 2
                     }
                 }

+ 2 - 2
plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml

@@ -180,7 +180,7 @@ Cura.MachineAction
                 height: childrenRect.height
                 anchors.top: nozzleTempLabel.top
                 anchors.left: bedTempStatus.right
-                anchors.leftMargin: UM.Theme.getSize("default_margin").width/2
+                anchors.leftMargin: Math.floor(UM.Theme.getSize("default_margin").width/2)
                 visible: checkupMachineAction.usbConnected
                 Button
                 {
@@ -241,7 +241,7 @@ Cura.MachineAction
                 height: childrenRect.height
                 anchors.top: bedTempLabel.top
                 anchors.left: bedTempStatus.right
-                anchors.leftMargin: UM.Theme.getSize("default_margin").width/2
+                anchors.leftMargin: Math.floor(UM.Theme.getSize("default_margin").width/2)
                 visible: checkupMachineAction.usbConnected && manager.hasHeatedBed
                 Button
                 {

+ 1 - 1
resources/qml/Cura.qml

@@ -484,7 +484,7 @@ UM.MainWindow
                 anchors
                 {
                     horizontalCenter: parent.horizontalCenter
-                    horizontalCenterOffset: -(UM.Theme.getSize("sidebar").width/ 2)
+                    horizontalCenterOffset: -(Math.floor(UM.Theme.getSize("sidebar").width/ 2))
                     top: parent.verticalCenter;
                     bottom: parent.bottom;
                 }

+ 1 - 1
resources/qml/ExtruderButton.qml

@@ -65,7 +65,7 @@ Button
 
         width: UM.Theme.getSize("extruder_button_material").width
         height: UM.Theme.getSize("extruder_button_material").height
-        radius: width / 2
+        radius: Math.floor(width / 2)
 
         border.width: UM.Theme.getSize("default_lining").width
         border.color: UM.Theme.getColor("extruder_button_material_border")

+ 1 - 1
resources/qml/MonitorButton.qml

@@ -225,7 +225,7 @@ Item
         width: parent.width - 2 * UM.Theme.getSize("sidebar_margin").width;
         height: UM.Theme.getSize("progressbar").height;
         anchors.top: statusLabel.bottom;
-        anchors.topMargin: UM.Theme.getSize("sidebar_margin").height / 4;
+        anchors.topMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height / 4);
         anchors.left: parent.left;
         anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width;
     }

+ 2 - 2
resources/qml/SaveButton.qml

@@ -76,7 +76,7 @@ Item {
         width: parent.width - 2 * UM.Theme.getSize("sidebar_margin").width
         height: UM.Theme.getSize("progressbar").height
         anchors.top: statusLabel.bottom
-        anchors.topMargin: UM.Theme.getSize("sidebar_margin").height/4
+        anchors.topMargin: Math.floor(UM.Theme.getSize("sidebar_margin").height/4)
         anchors.left: parent.left
         anchors.leftMargin: UM.Theme.getSize("sidebar_margin").width
         radius: UM.Theme.getSize("progressbar_radius").width
@@ -354,7 +354,7 @@ Item {
                     }
                     Behavior on color { ColorAnimation { duration: 50; } }
                     anchors.left: parent.left
-                    anchors.leftMargin: UM.Theme.getSize("save_button_text_margin").width / 2;
+                    anchors.leftMargin: Math.floor(UM.Theme.getSize("save_button_text_margin").width / 2);
                     width: parent.height
                     height: parent.height
 

+ 2 - 2
resources/qml/Settings/SettingCategory.qml

@@ -193,7 +193,7 @@ Button
         anchors {
             right: inheritButton.visible ? inheritButton.left : parent.right
             // use 1.9 as the factor because there is a 0.1 difference between the settings and inheritance warning icons
-            rightMargin: inheritButton.visible ? UM.Theme.getSize("default_margin").width / 2 : category_arrow.width + UM.Theme.getSize("default_margin").width * 1.9
+            rightMargin: inheritButton.visible ? Math.floor(UM.Theme.getSize("default_margin").width / 2) : category_arrow.width + Math.floor(UM.Theme.getSize("default_margin").width * 1.9)
             verticalCenter: parent.verticalCenter
         }
 
@@ -231,7 +231,7 @@ Button
             return false
         }
 
-        height: parent.height / 2
+        height: Math.floor(parent.height / 2)
         width: height
 
         onClicked:

+ 2 - 2
resources/qml/Settings/SettingCheckBox.qml

@@ -118,8 +118,8 @@ SettingItem
             UM.RecolorImage {
                 anchors.verticalCenter: parent.verticalCenter
                 anchors.horizontalCenter: parent.horizontalCenter
-                width: parent.width / 2.5
-                height: parent.height / 2.5
+                width: Math.floor(parent.width / 2.5)
+                height: Math.floor(parent.height / 2.5)
                 sourceSize.width: width
                 sourceSize.height: width
                 color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text");

+ 1 - 1
resources/qml/Settings/SettingComboBox.qml

@@ -61,7 +61,7 @@ SettingItem
         {
             id: downArrow
             x: control.width - width - control.rightPadding
-            y: control.topPadding + (control.availableHeight - height) / 2
+            y: control.topPadding + Math.floor((control.availableHeight - height) / 2)
 
             source: UM.Theme.getIcon("arrow_bottom")
             width: UM.Theme.getSize("standard_arrow").width

+ 6 - 6
resources/qml/Settings/SettingExtruder.qml

@@ -126,16 +126,16 @@ SettingItem
             background: Rectangle
             {
                 id: swatch
-                height: UM.Theme.getSize("setting_control").height / 2
+                height: Math.floor(UM.Theme.getSize("setting_control").height / 2)
                 width: height
 
                 anchors.right: parent.right
                 anchors.verticalCenter: parent.verticalCenter
-                anchors.margins: UM.Theme.getSize("default_margin").width / 4
+                anchors.margins: Math.floor(UM.Theme.getSize("default_margin").width / 4)
 
                 border.width: UM.Theme.getSize("default_lining").width
                 border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
-                radius: width / 2
+                radius: Math.floor(width / 2)
 
                 color: control.color
             }
@@ -180,16 +180,16 @@ SettingItem
                 background: Rectangle
                 {
                     id: swatch
-                    height: UM.Theme.getSize("setting_control").height / 2
+                    height: Math.floor(UM.Theme.getSize("setting_control").height / 2)
                     width: height
 
                     anchors.right: parent.right
                     anchors.verticalCenter: parent.verticalCenter
-                    anchors.margins: UM.Theme.getSize("default_margin").width / 4
+                    anchors.margins: Math.floor(UM.Theme.getSize("default_margin").width / 4)
 
                     border.width: UM.Theme.getSize("default_lining").width
                     border.color: enabled ? UM.Theme.getColor("setting_control_border") : UM.Theme.getColor("setting_control_disabled_border")
-                    radius: width / 2
+                    radius: Math.floor(width / 2)
 
                     color: control.model.getItem(index).color
                 }

Некоторые файлы не были показаны из-за большого количества измененных файлов