aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock_iterator.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-02-21 18:28:33 +0100
committerSebastian Geerken <devnull@localhost>2013-02-21 18:28:33 +0100
commit1b1666e45f4ca04689dc63f802deadcbc91223cd (patch)
tree69fe4519e50c4972622e72a466dc05623509ee27 /dw/textblock_iterator.cc
parent71a14283e7c5d12730f47d5a39a612120e63847b (diff)
parentcba0f9f7a7c9066011f305fa92403755f0adab9c (diff)
Merge with main repo.
Diffstat (limited to 'dw/textblock_iterator.cc')
-rw-r--r--dw/textblock_iterator.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/dw/textblock_iterator.cc b/dw/textblock_iterator.cc
index 285921b2..0956ef29 100644
--- a/dw/textblock_iterator.cc
+++ b/dw/textblock_iterator.cc
@@ -295,7 +295,11 @@ void Textblock::TextblockIterator::getAllocation (int start, int end,
}
if (start > 0 && word->content.type == core::Content::TEXT) {
allocation->x += textblock->textWidth (word->content.text, 0, start,
- word->style);
+ word->style,
+ word->flags & Word::WORD_START,
+ (word->flags & Word::WORD_END)
+ && word->content.text[start]
+ == 0);
}
allocation->y = textblock->lineYOffsetCanvas (line) + line->boxAscent -
word->size.ascent;
@@ -308,7 +312,11 @@ void Textblock::TextblockIterator::getAllocation (int start, int end,
end = misc::min(end, wordEnd); /* end could be INT_MAX */
allocation->width =
textblock->textWidth (word->content.text, start, end - start,
- word->style);
+ word->style,
+ (word->flags & Word::WORD_START)
+ && start == 0,
+ (word->flags & Word::WORD_END)
+ && word->content.text[end] == 0);
}
}
allocation->ascent = word->size.ascent;