Priority: P3: Somewhat important
Affects Version/s: 6.0
Fix Version/s: None
Component/s: GUI: Text handling
When centering a text item using anchors.centerIn or anchors.horizontalCenter, it will be aligned to the pixel grid to make rendering sharper.
There is an anchors.alignWhenCentered property that can be used to disable this, if you are aiming for correctness.
But horizontalAlignment in the Text element does not align and draws at subpixel positions if requested.
This means that if you have items that are centered using the anchors along side Text items that are centered, and you resize the containing item, you may see some flinching due to the centering acting differently for the two.
Ideally, the two algorithms would give the exact same results, but this needs to be investigated properly first. It is also possible the problem is in the anchors itself, which seems to A. assume that the widths of items are integers and B. may be rounding each center individually (round(item1.width / 2) - round(item2.width / 2), which gives a higher error margin than round(item1.width / 2 - item2.width / 2).
But I haven't dug very deep, so I may be reading it wrong.
|For Gerrit Dashboard: QTBUG-84021|
|299393,3||Revert "Text: Fix kerning when horizontalAlignment is set to center"||dev||qt/qtdeclarative||Status: MERGED||+2||0|
|301780,2||Revert "Text: Fix kerning when horizontalAlignment is set to center"||5.15||qt/qtdeclarative||Status: MERGED||+2||0|