aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquicktext.cpp')
-rw-r--r--src/quick/items/qquicktext.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index f618a55760..e5976acb1e 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -62,6 +62,7 @@ QQuickTextPrivate::QQuickTextPrivate()
, layoutTextElided(false), textHasChanged(true), needToUpdateLayout(false), formatModifiesFontSize(false)
, polishSize(false)
, updateSizeRecursionGuard(false)
+ , containsUnscalableGlyphs(false)
{
implicitAntialiasing = true;
}
@@ -1697,7 +1698,7 @@ void QQuickText::itemChange(ItemChange change, const ItemChangeData &value)
break;
case ItemDevicePixelRatioHasChanged:
- if (d->renderType == NativeRendering) {
+ if (d->containsUnscalableGlyphs) {
// Native rendering optimizes for a given pixel grid, so its results must not be scaled.
// Text layout code respects the current device pixel ratio automatically, we only need
// to rerun layout after the ratio changed.
@@ -2495,6 +2496,7 @@ QSGNode *QQuickText::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data
Q_D(QQuickText);
if (d->text.isEmpty()) {
+ d->containsUnscalableGlyphs = false;
delete oldNode;
return nullptr;
}
@@ -2553,6 +2555,8 @@ QSGNode *QQuickText::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data
}
}
+ d->containsUnscalableGlyphs = node->containsUnscalableGlyphs();
+
// The font caches have now been initialized on the render thread, so they have to be
// invalidated before we can use them from the main thread again.
invalidateFontCaches();