diff options
Diffstat (limited to 'src/quick/items/qquicktext.cpp')
-rw-r--r-- | src/quick/items/qquicktext.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 8288554028..80321cf5d1 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -897,11 +897,11 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const baseline) // If the width of the item has changed and it's possible the result of wrapping, // eliding, scaling has changed, or the text is not left aligned do another layout. - if ((lineWidth < qMin(oldWidth, naturalWidth) || (widthExceeded && lineWidth > oldWidth)) + if ((!qFuzzyCompare(lineWidth, oldWidth) || (widthExceeded && lineWidth > oldWidth)) && (singlelineElide || multilineElide || canWrap || horizontalFit || q->effectiveHAlign() != QQuickText::AlignLeft)) { widthChanged = true; - widthExceeded = false; + widthExceeded = lineWidth >= qMin(oldWidth, naturalWidth); heightExceeded = false; continue; } @@ -936,7 +936,7 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const baseline) bool wasInLayout = internalWidthUpdate; internalWidthUpdate = true; - q->setImplicitHeight(naturalHeight); + q->setImplicitHeight(naturalHeight + q->topPadding() + q->bottomPadding()); internalWidthUpdate = wasInLayout; multilineElide = elideMode == QQuickText::ElideRight |