mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 03:07:53 -06:00
Fix text alignments by using rounding
CURA-6598
This commit is contained in:
parent
52f3f9b773
commit
39d52556f4
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue