WordWrapper: preserve word order
This commit is contained in:
parent
fd9a0a2199
commit
57625a1ea9
1 changed files with 2 additions and 2 deletions
|
@ -52,7 +52,7 @@ class TextLineWrapImpl implements WordWrapper {
|
||||||
while (!wordQ.isEmpty()) {
|
while (!wordQ.isEmpty()) {
|
||||||
Word word = wordQ.pop();
|
Word word = wordQ.pop();
|
||||||
if ((bottom + word.height) > height) {
|
if ((bottom + word.height) > height) {
|
||||||
wordQ.push(word);
|
wordQ.add(word);
|
||||||
lineQ.forEach(wordQ::push);
|
lineQ.forEach(wordQ::push);
|
||||||
return removeBlankLines(lines);
|
return removeBlankLines(lines);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ class TextLineWrapImpl implements WordWrapper {
|
||||||
end = 0;
|
end = 0;
|
||||||
bottom += word.height;
|
bottom += word.height;
|
||||||
}
|
}
|
||||||
lineQ.push(word);
|
lineQ.add(word);
|
||||||
end += word.width;
|
end += word.width;
|
||||||
}
|
}
|
||||||
lines.add(wordsAsString(lineQ));
|
lines.add(wordsAsString(lineQ));
|
||||||
|
|
Loading…
Reference in a new issue