aboutsummaryrefslogtreecommitdiff
path: root/dw/textblock_linebreaking.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2012-11-14 12:27:50 +0100
committerSebastian Geerken <devnull@localhost>2012-11-14 12:27:50 +0100
commit7a991750e1f7bdfe6bd39f95343cc742d00c6596 (patch)
tree63ca76e60873f69ad31b80fe99bc10d497b5a87c /dw/textblock_linebreaking.cc
parentc762eb9ab50bcc5d35194a82cf7837dbd3604984 (diff)
Penalty index is now calculated correctly.
Diffstat (limited to 'dw/textblock_linebreaking.cc')
-rw-r--r--dw/textblock_linebreaking.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc
index c98596c6..bac23cb9 100644
--- a/dw/textblock_linebreaking.cc
+++ b/dw/textblock_linebreaking.cc
@@ -487,7 +487,7 @@ void Textblock::wordWrap (int wordIndex, bool wrapAll)
accumulateWordData (wordIndex);
- int penaltyIndex = 0;
+ int penaltyIndex = calcPenaltyIndexForNewLine ();
bool newLine;
do {
@@ -615,6 +615,7 @@ void Textblock::wordWrap (int wordIndex, bool wrapAll)
tempNewLine ? "temporally" : "permanently",
firstIndex, breakPos);
lineAdded = true;
+ penaltyIndex = calcPenaltyIndexForNewLine ();
} else {
// TODO hyphenateWord() should return whether something has
// changed at all. So that a second run, with