mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-27 16:22:00 +08:00
Fix text alignments by using rounding
CURA-6598
This commit is contained in:
parent
52f3f9b773
commit
39d52556f4
@ -32,8 +32,9 @@ Item
|
|||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.maximumWidth: index + 1 === repeater.count || repeater.count <= 1 ? itemSize : base.width / (repeater.count - 1)
|
Layout.maximumWidth: Math.round(index + 1 === repeater.count || repeater.count <= 1 ? itemSize : base.width / (repeater.count - 1))
|
||||||
height: label.height
|
height: label.height
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: label
|
id: label
|
||||||
@ -52,7 +53,7 @@ Item
|
|||||||
// We want the center of the label to align with the center of the item, so we negatively offset by half the contentWidth
|
// We want the center of the label to align with the center of the item, so we negatively offset by half the contentWidth
|
||||||
right: index + 1 === repeater.count ? parent.right: undefined
|
right: index + 1 === repeater.count ? parent.right: undefined
|
||||||
left: index + 1 === repeater.count || index === 0 ? undefined: parent.left
|
left: index + 1 === repeater.count || index === 0 ? undefined: parent.left
|
||||||
leftMargin: (0.5 * itemSize) - 0.5 * contentWidth
|
leftMargin: Math.round((itemSize - contentWidth) * 0.5)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user