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 14268b472e..2bfb4501fc 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -898,11 +898,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; } @@ -937,7 +937,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 |