changeset 1294:019d5ca2152f

TextblockIterator::getAllocation(): take spaces into account This is why findtext wasn't always scrolling far enough horizontally.
author corvid <corvid@lavabit.com>
date Tue, 01 Sep 2009 21:23:35 +0000
parents 090cc554fefb
children c69938e3b41c
files dw/textblock.cc
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dw/textblock.cc	Tue Sep 01 22:02:28 2009 +0200
+++ b/dw/textblock.cc	Tue Sep 01 21:23:35 2009 +0000
@@ -2155,9 +2155,10 @@
 
    allocation->x =
       textblock->allocation.x + textblock->lineXOffsetWidget (line);
-   for (int i = line->firstWord; i < index; i++)
-      allocation->x += textblock->words->getRef(i)->size.width;
-
+   for (int i = line->firstWord; i < index; i++) {
+      Word *w = textblock->words->getRef(i);
+      allocation->x += w->size.width + w->effSpace;
+   }
    allocation->y =
       textblock->allocation.y
       + textblock->lineYOffsetWidget (line) + line->ascent - word->size.ascent;