aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextnodeengine.cpp
diff options
context:
space:
mode:
authorWang Chuan <ouchuanm@outlook.com>2020-01-05 09:34:28 +0800
committerWang Chuan <ouchuanm@outlook.com>2020-01-16 15:00:39 +0800
commit7b4275b541808a5c26b2524b3bde2b1f9bc56fc1 (patch)
tree06fab0f0bcbb294e55caff918d21aaa755ab26b1 /src/quick/items/qquicktextnodeengine.cpp
parent43e3c21a0bad9141b6c35cc4ee4a58b4d824462a (diff)
QQuickTextNodeEngine: reduce redundant rendering of glyphs
The glyphs between two text blocks that have different text format will be rendered twice, and in this case the rich text will be display incorrectly.(e.g., the first text block is a superscript and the second is a normal text) Fixes this by reduce the redundant rendering of glyphs between two differently formatted text blocks Fixes: QTBUG-80759 Change-Id: I51ca3f7df1ad368d28df9beb6124a87bf50f0e01 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquicktextnodeengine.cpp')
-rw-r--r--src/quick/items/qquicktextnodeengine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp
index a0ae4e5f97..2356ab36ef 100644
--- a/src/quick/items/qquicktextnodeengine.cpp
+++ b/src/quick/items/qquicktextnodeengine.cpp
@@ -532,7 +532,7 @@ void QQuickTextNodeEngine::addGlyphsForRanges(const QVarLengthArray<QTextLayout:
int remainingLength = end - start;
for (int j=0; j<ranges.size(); ++j) {
const QTextLayout::FormatRange &range = ranges.at(j);
- if (range.start + range.length >= currentPosition
+ if (range.start + range.length > currentPosition
&& range.start < currentPosition + remainingLength) {
if (range.start > currentPosition) {