aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-05-06 07:20:01 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-05-26 13:06:38 +0000
commit02518f242d589ebee93adafb2aa8cc630683cb7f (patch)
tree47a88769a1146e917e2de84f86f98a80bd7c2c34 /src/quick
parenta5d2fd816bcbee6026894927ae5d049536bfc7ea (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 Change-Id: Icf6d90c27b18a43d729007164f4e0058c51fb930 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit bb45fbe77d6547143434c7f5807475c40c913ae4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquicktextutil.cpp2
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;