Skip to content

Commit

Permalink
Fix wrong text wrap avoid in some case
Browse files Browse the repository at this point in the history
Don't avoid wrap at end of line when ending on a space
preceded by a CH_PROP_AVOID_WRAP_AFTER char.
  • Loading branch information
poire-z committed Dec 4, 2018
1 parent 74b7f39 commit 0879de5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crengine/src/lvtextfm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,9 @@ class LVFormatter {
break;
}
}
if (!avoidWrap) { // Look at preceding char(s)
if (!avoidWrap && i < m_length-1) { // Look at preceding char(s)
// (but not if it is the last char, where a wrap is fine
// even if it ends after a CH_PROP_AVOID_WRAP_AFTER char)
for (int j = i-1; j >= 0; j--) {
if ( !(m_flags[j] & LCHAR_ALLOW_WRAP_AFTER) ) { // not another (collapsible) space
avoidWrap = lGetCharProps(m_text[j]) & CH_PROP_AVOID_WRAP_AFTER;
Expand Down

0 comments on commit 0879de5

Please sign in to comment.