aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextnodeengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquicktextnodeengine.cpp')
-rw-r--r--src/quick/items/qquicktextnodeengine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp
index 34b9d6efa2..2872c3e230 100644
--- a/src/quick/items/qquicktextnodeengine.cpp
+++ b/src/quick/items/qquicktextnodeengine.cpp
@@ -828,14 +828,15 @@ void QQuickTextNodeEngine::addToSceneGraph(QQuickTextNode *parentNode,
for (int i = 0; i < node->ranges.size(); ++i) {
const QPair<int, int> &range = node->ranges.at(i);
- int rangeLength = range.second - range.first;
+ int rangeLength = range.second - range.first + 1;
if (previousNode != 0) {
for (int j = 0; j < previousNode->ranges.size(); ++j) {
const QPair<int, int> &otherRange = previousNode->ranges.at(j);
+
if (range.first < otherRange.second && range.second > otherRange.first) {
int start = qMax(range.first, otherRange.first);
int end = qMin(range.second, otherRange.second);
- rangeLength -= end - start;
+ rangeLength -= end - start + 1;
if (rangeLength == 0)
break;
}
@@ -849,7 +850,7 @@ void QQuickTextNodeEngine::addToSceneGraph(QQuickTextNode *parentNode,
if (range.first < otherRange.second && range.second > otherRange.first) {
int start = qMax(range.first, otherRange.first);
int end = qMin(range.second, otherRange.second);
- rangeLength -= end - start;
+ rangeLength -= end - start + 1;
if (rangeLength == 0)
break;
}