diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-05-06 07:20:01 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-05-26 11:30:13 +0000 |
commit | bb45fbe77d6547143434c7f5807475c40c913ae4 (patch) | |
tree | c026be30221e8ee4325261cfb5387f86b3d0d920 /src/quick/items/qquicktextutil.cpp | |
parent | 8afbdbdc9f33623987e9ecc42d2c7b05754e31c9 (diff) |
Revert "Text: Fix kerning when horizontalAlignment is set to center"
This reverts commit c8bba05dc54231dbc5dc859f125d64b640e25a41.
The original commit was working around a kerning issue when text
was subpixel positioned. Since anchor centering is already pixel
aligned, it was regarded as an improvement regardless, but the main
goal was to fix the kerning issue.
But in an attempt at matching the anchor centering, we rounded
the center of the text item and instead of the left edge (my
request / mistake), and the result was that some cases were
still broken and upon closer investigation, the positioning
still did not match the anchors alignment exactly.
The original kerning issue has now been fixed in
e807f9d1d80559b8ff91f1c3cfdd755b3da56a6d, so this change is no
longer needed. Since it also does not correctly match the
alignment of the anchors, it does not have any additional purpose.
Task-number: QTBUG-84021
Task-number: QTBUG-49646
Pick-to: 5.15
Change-Id: Icf6d90c27b18a43d729007164f4e0058c51fb930
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/quick/items/qquicktextutil.cpp')
-rw-r--r-- | src/quick/items/qquicktextutil.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextutil.cpp b/src/quick/items/qquicktextutil.cpp index 024b2b7a5b..eb356a9c48 100644 --- a/src/quick/items/qquicktextutil.cpp +++ b/src/quick/items/qquicktextutil.cpp @@ -87,7 +87,7 @@ qreal QQuickTextUtil::alignedX(const qreal textWidth, const qreal itemWidth, int x = itemWidth - textWidth; break; case Qt::AlignHCenter: - x = qRound(itemWidth / 2.0) - textWidth / 2.0; + x = (itemWidth - textWidth) / 2; break; } return x; |