summaryrefslogtreecommitdiff
path: root/dw/textblock_iterator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/textblock_iterator.cc')
-rw-r--r--dw/textblock_iterator.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/dw/textblock_iterator.cc b/dw/textblock_iterator.cc
index cfd27941..245df374 100644
--- a/dw/textblock_iterator.cc
+++ b/dw/textblock_iterator.cc
@@ -145,6 +145,11 @@ void Textblock::TextblockIterator::unhighlight (int direction,
if (textblock->hlStart[layer].index > textblock->hlEnd[layer].index)
return;
+ int oldStartIndex = textblock->hlStart[layer].index;
+ int oldStartChar = textblock->hlStart[layer].nChar;
+ int oldEndIndex = textblock->hlEnd[layer].index;
+ int oldEndChar = textblock->hlEnd[layer].nChar;
+
if (direction == 0) {
index1 = textblock->hlStart[layer].index;
index2 = textblock->hlEnd[layer].index;
@@ -160,7 +165,11 @@ void Textblock::TextblockIterator::unhighlight (int direction,
textblock->hlEnd[layer].nChar = INT_MAX;
}
- textblock->queueDrawRange (index1, index2);
+ if (oldStartIndex != textblock->hlStart[layer].index ||
+ oldStartChar != textblock->hlStart[layer].nChar ||
+ oldEndIndex != textblock->hlEnd[layer].index ||
+ oldEndChar != textblock->hlEnd[layer].nChar)
+ textblock->queueDrawRange (index1, index2);
}
void Textblock::TextblockIterator::getAllocation (int start, int end,