From 53bdf7daa1c598082dfde8bfbf40709f37f866e6 Mon Sep 17 00:00:00 2001
From: Andrew den Exter <andrew.den.exter@jollamobile.com>
Date: Mon, 10 Jun 2013 21:17:02 +1000
Subject: [PATCH] Ensure the vertical text alignment is updated when the Text
 height changes.

Task-number: QTBUG-31647

Change-Id: Ia0968a7a40c40411df5b3ed841a42f6cef141525
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Vesa Halttunen
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
---
 src/quick/items/qquicktext.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index fbf46f51e4..b46f2e5ab9 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -2155,9 +2155,10 @@ void QQuickText::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeo
     if ((!widthChanged && !heightChanged) || d->internalWidthUpdate)
         goto geomChangeDone;
 
-    if (effectiveHAlign() != QQuickText::AlignLeft && widthChanged) {
+    if ((effectiveHAlign() != QQuickText::AlignLeft && widthChanged)
+            || vAlign() != QQuickText::AlignTop && heightChanged) {
         // If the width has changed and we're not left aligned do an update so the text is
-        // repositioned even if a full layout isn't required.
+        // repositioned even if a full layout isn't required. And the same for vertical.
         d->updateType = QQuickTextPrivate::UpdatePaintNode;
         update();
     }
-- 
GitLab