diff options
author | Sebastian Geerken <devnull@localhost> | 2012-11-27 15:33:39 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2012-11-27 15:33:39 +0100 |
commit | 1250d68c8767232849145d9e6abe681a562f6f5d (patch) | |
tree | 56e3c7a1754b657977f9fe4ed06bbd70840d6be3 /dw/textblock_linebreaking.cc | |
parent | ff3b586010ee8369868d177c0acc6ae41d3e3007 (diff) |
Introduced UNBREAKABLE_FOR_MIN_WIDTH (not used yet).
Diffstat (limited to 'dw/textblock_linebreaking.cc')
-rw-r--r-- | dw/textblock_linebreaking.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc index 47027194..a1682e19 100644 --- a/dw/textblock_linebreaking.cc +++ b/dw/textblock_linebreaking.cc @@ -217,15 +217,17 @@ void Textblock::printWord (Word *word) printf ("\"%s\"", word->content.text); break; case core::Content::WIDGET: - printf ("<widget: %p>\n", word->content.widget); + printf ("<widget: %p>", word->content.widget); break; case core::Content::BREAK: - printf ("<break>\n"); + printf ("<break>"); break; default: - printf ("<?>\n"); + printf ("<?>"); break; } + + printf (" (flags = %d)", word->flags); printf (" [%d / %d + %d - %d => %d + %d - %d] => ", word->size.width, word->origSpace, word->stretchability, @@ -422,7 +424,7 @@ void Textblock::accumulateWordExtremes (int firstWord, int lastWord, // Minimum: between two *possible* breaks (or at the end). // TODO This is redundant to getExtremesImpl(). - // TODO Again, index 1 is used for lineCanBeBroken(). See getExtremes(). + // TODO: Again, index 1 is used for lineCanBeBroken(). See getExtremes(). if (word->badnessAndPenalty.lineCanBeBroken (1) || atLastWord) { parMin += extremes.minWidth + word->hyphenWidth; *maxOfMinWidth = misc::max (*maxOfMinWidth, parMin); @@ -704,7 +706,8 @@ int Textblock::hyphenateWord (int wordIndex) penalties[PENALTY_HYPHEN][1]); w->hyphenWidth = layout->textWidth (origWord.style->font, "\xc2\xad", 2); - w->flags |= (Word::DRAW_AS_ONE_TEXT | Word::DIV_CHAR_AT_EOL); + w->flags |= (Word::DRAW_AS_ONE_TEXT | Word::DIV_CHAR_AT_EOL | + Word::UNBREAKABLE_FOR_MIN_WIDTH); PRINTF (" [%d] + hyphen\n", wordIndex + i); } else { |