mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-11 16:00:47 -07:00
Change Math.floor to Math.round as a last try to fix garbled fonts
CURA-4941
This commit is contained in:
parent
a792fc59eb
commit
b531c0550d
36 changed files with 213 additions and 213 deletions
|
|
@ -70,8 +70,8 @@ Cura.MachineAction
|
|||
anchors.top: pageTitle.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
|
||||
property real columnWidth: Math.floor((width - 3 * UM.Theme.getSize("default_margin").width) / 2)
|
||||
property real labelColumnWidth: Math.floor(columnWidth / 2)
|
||||
property real columnWidth: Math.round((width - 3 * UM.Theme.getSize("default_margin").width) / 2)
|
||||
property real labelColumnWidth: Math.round(columnWidth / 2)
|
||||
|
||||
Tab
|
||||
{
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ Item {
|
|||
|
||||
Button
|
||||
{
|
||||
width: Math.floor(UM.Theme.getSize("setting").height / 2)
|
||||
width: Math.round(UM.Theme.getSize("setting").height / 2)
|
||||
height: UM.Theme.getSize("setting").height
|
||||
|
||||
onClicked: addedSettingsModel.setVisible(model.key, false)
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ UM.Dialog
|
|||
{
|
||||
UM.I18nCatalog{id: catalog; name:"cura"}
|
||||
id: base
|
||||
property int columnWidth: Math.floor((base.width / 2) - UM.Theme.getSize("default_margin").width)
|
||||
property int textMargin: Math.floor(UM.Theme.getSize("default_margin").width / 2)
|
||||
property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width)
|
||||
property int textMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
|
||||
property string activeScriptName
|
||||
SystemPalette{ id: palette }
|
||||
SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled }
|
||||
|
|
@ -129,8 +129,8 @@ UM.Dialog
|
|||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.floor(control.width / 2.7)
|
||||
height: Math.floor(control.height / 2.7)
|
||||
width: Math.round(control.width / 2.7)
|
||||
height: Math.round(control.height / 2.7)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: palette.text
|
||||
|
|
@ -164,8 +164,8 @@ UM.Dialog
|
|||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.floor(control.width / 2.5)
|
||||
height: Math.floor(control.height / 2.5)
|
||||
width: Math.round(control.width / 2.5)
|
||||
height: Math.round(control.height / 2.5)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: control.enabled ? palette.text : disabledPalette.text
|
||||
|
|
@ -199,8 +199,8 @@ UM.Dialog
|
|||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.floor(control.width / 2.5)
|
||||
height: Math.floor(control.height / 2.5)
|
||||
width: Math.round(control.width / 2.5)
|
||||
height: Math.round(control.height / 2.5)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: control.enabled ? palette.text : disabledPalette.text
|
||||
|
|
@ -478,15 +478,15 @@ UM.Dialog
|
|||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Math.floor(UM.Theme.getSize("save_button_text_margin").width / 2);
|
||||
anchors.leftMargin: Math.round(UM.Theme.getSize("save_button_text_margin").width / 2);
|
||||
width: parent.height
|
||||
height: parent.height
|
||||
|
||||
UM.RecolorImage {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.floor(parent.width / 2)
|
||||
height: Math.floor(parent.height / 2)
|
||||
width: Math.round(parent.width / 2)
|
||||
height: Math.round(parent.height / 2)
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ UM.PointingRectangle {
|
|||
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: Math.floor(UM.Theme.getSize("default_margin").width / 2)
|
||||
leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ UM.PointingRectangle {
|
|||
|
||||
anchors {
|
||||
left: parent.right
|
||||
leftMargin: Math.floor(UM.Theme.getSize("default_margin").width / 2)
|
||||
leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ Item
|
|||
Button {
|
||||
id: collapseButton
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Math.floor(UM.Theme.getSize("default_margin").height + (UM.Theme.getSize("layerview_row").height - UM.Theme.getSize("default_margin").height) / 2)
|
||||
anchors.topMargin: Math.round(UM.Theme.getSize("default_margin").height + (UM.Theme.getSize("layerview_row").height - UM.Theme.getSize("default_margin").height) / 2)
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ Item
|
|||
|
||||
Item
|
||||
{
|
||||
height: Math.floor(UM.Theme.getSize("default_margin").width / 2)
|
||||
height: Math.round(UM.Theme.getSize("default_margin").width / 2)
|
||||
width: width
|
||||
}
|
||||
|
||||
|
|
@ -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: Math.floor(width / 2)
|
||||
radius: Math.round(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 + Math.floor(UM.Theme.getSize("default_margin").width/2)
|
||||
anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.round(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 + Math.floor(UM.Theme.getSize("default_margin").width/2)
|
||||
anchors.leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width/2)
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width * 2
|
||||
}
|
||||
}
|
||||
|
|
@ -461,7 +461,7 @@ Item
|
|||
visible: viewSettings.show_feedrate_gradient
|
||||
anchors.left: parent.right
|
||||
height: parent.width
|
||||
width: Math.floor(UM.Theme.getSize("layerview_row").height * 1.5)
|
||||
width: Math.round(UM.Theme.getSize("layerview_row").height * 1.5)
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
transform: Rotation {origin.x: 0; origin.y: 0; angle: 90}
|
||||
|
|
@ -492,7 +492,7 @@ Item
|
|||
visible: viewSettings.show_thickness_gradient
|
||||
anchors.left: parent.right
|
||||
height: parent.width
|
||||
width: Math.floor(UM.Theme.getSize("layerview_row").height * 1.5)
|
||||
width: Math.round(UM.Theme.getSize("layerview_row").height * 1.5)
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
transform: Rotation {origin.x: 0; origin.y: 0; angle: 90}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ Cura.MachineAction
|
|||
|
||||
Column
|
||||
{
|
||||
width: Math.floor(parent.width * 0.5)
|
||||
width: Math.round(parent.width * 0.5)
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
ScrollView
|
||||
|
|
@ -198,7 +198,7 @@ Cura.MachineAction
|
|||
}
|
||||
Column
|
||||
{
|
||||
width: Math.floor(parent.width * 0.5)
|
||||
width: Math.round(parent.width * 0.5)
|
||||
visible: base.selectedPrinter ? true : false
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
Label
|
||||
|
|
@ -216,13 +216,13 @@ Cura.MachineAction
|
|||
columns: 2
|
||||
Label
|
||||
{
|
||||
width: Math.floor(parent.width * 0.5)
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
text: catalog.i18nc("@label", "Type")
|
||||
}
|
||||
Label
|
||||
{
|
||||
width: Math.floor(parent.width * 0.5)
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
text:
|
||||
{
|
||||
|
|
@ -247,25 +247,25 @@ Cura.MachineAction
|
|||
}
|
||||
Label
|
||||
{
|
||||
width: Math.floor(parent.width * 0.5)
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
text: catalog.i18nc("@label", "Firmware version")
|
||||
}
|
||||
Label
|
||||
{
|
||||
width: Math.floor(parent.width * 0.5)
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
text: base.selectedPrinter ? base.selectedPrinter.firmwareVersion : ""
|
||||
}
|
||||
Label
|
||||
{
|
||||
width: Math.floor(parent.width * 0.5)
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
text: catalog.i18nc("@label", "Address")
|
||||
}
|
||||
Label
|
||||
{
|
||||
width: Math.floor(parent.width * 0.5)
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
text: base.selectedPrinter ? base.selectedPrinter.ipAddress : ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ Component
|
|||
}
|
||||
return (sourceSize.width / sourceSize.height) > (maximumWidth / maximumHeight);
|
||||
}
|
||||
property real _width: Math.floor(Math.min(maximumWidth, sourceSize.width))
|
||||
property real _height: Math.floor(Math.min(maximumHeight, sourceSize.height))
|
||||
width: proportionalHeight ? _width : Math.floor(sourceSize.width * _height / sourceSize.height)
|
||||
height: !proportionalHeight ? _height : Math.floor(sourceSize.height * _width / sourceSize.width)
|
||||
property real _width: Math.round(Math.min(maximumWidth, sourceSize.width))
|
||||
property real _height: Math.round(Math.min(maximumHeight, sourceSize.height))
|
||||
width: proportionalHeight ? _width : Math.round(sourceSize.width * _height / sourceSize.height)
|
||||
height: !proportionalHeight ? _height : Math.round(sourceSize.height * _width / sourceSize.width)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
onVisibleChanged:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Item
|
|||
id: extruderInfo
|
||||
property var printCoreConfiguration
|
||||
|
||||
width: Math.floor(parent.width / 2)
|
||||
width: Math.round(parent.width / 2)
|
||||
height: childrenRect.height
|
||||
Label
|
||||
{
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ Rectangle
|
|||
|
||||
Rectangle
|
||||
{
|
||||
width: Math.floor(parent.width / 3)
|
||||
width: Math.round(parent.width / 3)
|
||||
height: parent.height
|
||||
|
||||
Label // Print job name
|
||||
|
|
@ -131,7 +131,7 @@ Rectangle
|
|||
|
||||
Rectangle
|
||||
{
|
||||
width: Math.floor(parent.width / 3 * 2)
|
||||
width: Math.round(parent.width / 3 * 2)
|
||||
height: parent.height
|
||||
|
||||
Label // Friendly machine name
|
||||
|
|
@ -139,7 +139,7 @@ Rectangle
|
|||
id: printerNameLabel
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width - showCameraIcon.width)
|
||||
width: Math.round(parent.width / 2 - UM.Theme.getSize("default_margin").width - showCameraIcon.width)
|
||||
text: printer.friendly_name
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
elide: Text.ElideRight
|
||||
|
|
@ -149,7 +149,7 @@ Rectangle
|
|||
{
|
||||
id: printerTypeLabel
|
||||
anchors.top: printerNameLabel.bottom
|
||||
width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width)
|
||||
width: Math.round(parent.width / 2 - UM.Theme.getSize("default_margin").width)
|
||||
text: printer.machine_variant
|
||||
anchors.left: parent.left
|
||||
elide: Text.ElideRight
|
||||
|
|
@ -183,7 +183,7 @@ Rectangle
|
|||
id: extruderInfo
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width)
|
||||
width: Math.round(parent.width / 2 - UM.Theme.getSize("default_margin").width)
|
||||
height: childrenRect.height
|
||||
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
|
@ -191,7 +191,7 @@ Rectangle
|
|||
PrintCoreConfiguration
|
||||
{
|
||||
id: leftExtruderInfo
|
||||
width: Math.floor((parent.width - extruderSeperator.width) / 2)
|
||||
width: Math.round((parent.width - extruderSeperator.width) / 2)
|
||||
printCoreConfiguration: printer.configuration[0]
|
||||
}
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ Rectangle
|
|||
PrintCoreConfiguration
|
||||
{
|
||||
id: rightExtruderInfo
|
||||
width: Math.floor((parent.width - extruderSeperator.width) / 2)
|
||||
width: Math.round((parent.width - extruderSeperator.width) / 2)
|
||||
printCoreConfiguration: printer.configuration[1]
|
||||
}
|
||||
}
|
||||
|
|
@ -217,7 +217,7 @@ Rectangle
|
|||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
height: showExtended ? parent.height: printProgressTitleBar.height
|
||||
width: Math.floor(parent.width / 2 - UM.Theme.getSize("default_margin").width)
|
||||
width: Math.round(parent.width / 2 - UM.Theme.getSize("default_margin").width)
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: lineColor
|
||||
radius: cornerRadius
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ Item
|
|||
{
|
||||
id: cameraImage
|
||||
width: Math.min(sourceSize.width === 0 ? 800 * screenScaleFactor : sourceSize.width, maximumWidth)
|
||||
height: Math.floor((sourceSize.height === 0 ? 600 * screenScaleFactor : sourceSize.height) * width / sourceSize.width)
|
||||
height: Math.round((sourceSize.height === 0 ? 600 * screenScaleFactor : sourceSize.height) * width / sourceSize.width)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
z: 1
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ Cura.MachineAction
|
|||
height: childrenRect.height
|
||||
anchors.top: nozzleTempLabel.top
|
||||
anchors.left: bedTempStatus.right
|
||||
anchors.leftMargin: Math.floor(UM.Theme.getSize("default_margin").width/2)
|
||||
anchors.leftMargin: Math.round(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: Math.floor(UM.Theme.getSize("default_margin").width/2)
|
||||
anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").width/2)
|
||||
visible: checkupMachineAction.usbConnected && manager.hasHeatedBed
|
||||
Button
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ import UM 1.3 as UM
|
|||
UM.Dialog
|
||||
{
|
||||
id: baseDialog
|
||||
minimumWidth: Math.floor(UM.Theme.getSize("modal_window_minimum").width * 0.75)
|
||||
minimumHeight: Math.floor(UM.Theme.getSize("modal_window_minimum").height * 0.5)
|
||||
minimumWidth: Math.round(UM.Theme.getSize("modal_window_minimum").width * 0.75)
|
||||
minimumHeight: Math.round(UM.Theme.getSize("modal_window_minimum").height * 0.5)
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
title: catalog.i18nc("@title:window", "User Agreement")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue