aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock_linebreaking.cc
diff options
context:
space:
mode:
authorsgeerken <devnull@localhost>2012-07-23 22:39:06 +0200
committersgeerken <devnull@localhost>2012-07-23 22:39:06 +0200
commit196933111c2d20973cbce20c6f51e32e977b9dcf (patch)
tree1f466d549bfd6ea5d58340d80c0de5437bd7309c /dw/textblock_linebreaking.cc
parentb75aaf12f8ee5ae5eb1d63b069e227b967e83e36 (diff)
Fixed bug with zero-height textblocks.
Diffstat (limited to 'dw/textblock_linebreaking.cc')
-rw-r--r--dw/textblock_linebreaking.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index d267e358..b8d94813 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -447,6 +447,15 @@ void Textblock::wordWrap (int wordIndex, bool wrapAll)
} else
newLine = false;
+ if(!newLine && !wrapAll)
+ // No new line is added. "mustQueueResize" must,
+ // nevertheless, be set, so that flush() will call
+ // queueResize(), and later sizeRequestImpl() is called,
+ // which then calls showMissingLines(), which eventually
+ // calls this method again, with wrapAll == true, so that
+ // newLine is calculated as "true".
+ mustQueueResize = true;
+
if(newLine) {
accumulateWordData (wordIndex, lines->size() - 1);
int wordIndexEnd = wordIndex;
@@ -878,6 +887,8 @@ void Textblock::showMissingLines ()
{
int firstWordToWrap = lines->size () > 0 ?
lines->getRef(lines->size () - 1)->lastWord + 1 : 0;
+ PRINTF ("[%p] SHOW_MISSING_LINES: wrap from %d to %d\n",
+ this, firstWordToWrap, words->size () - 1);
for (int i = firstWordToWrap; i < words->size (); i++)
wordWrap (i, true);
}