Commit b8a1c609 authored by twanvl's avatar twanvl

Fixed: direction:vertical was putting characters on the next line, causing...

Fixed: direction:vertical was putting characters on the next line, causing multi-char symbols to render incorrectly
parent 93054223
...@@ -520,9 +520,10 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars, ...@@ -520,9 +520,10 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
for(size_t i = 0 ; i < chars.size() ; ++i) { for(size_t i = 0 ; i < chars.size() ; ++i) {
const CharInfo& c = chars[i]; const CharInfo& c = chars[i];
// Should we break? // Should we break?
bool break_now = false; bool word_too_long = false;
bool accept_word = false; // the current word should be added to the line bool break_now = false;
bool hide_breaker = true; // hide the \n or _(' ') that caused a line break bool accept_word = false; // the current word should be added to the line
bool hide_breaker = true; // hide the \n or _(' ') that caused a line break
if (c.break_after == BREAK_SOFT || c.break_after == BREAK_HARD || c.break_after == BREAK_LINE) { if (c.break_after == BREAK_SOFT || c.break_after == BREAK_HARD || c.break_after == BREAK_LINE) {
break_now = true; break_now = true;
accept_word = true; accept_word = true;
...@@ -557,6 +558,7 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars, ...@@ -557,6 +558,7 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
break_now = true; break_now = true;
accept_word = true; accept_word = true;
hide_breaker = false; hide_breaker = false;
word_too_long = true;
line.break_after = BREAK_SOFT; line.break_after = BREAK_SOFT;
} }
} else { } else {
...@@ -580,7 +582,7 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars, ...@@ -580,7 +582,7 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
positions_word.clear(); positions_word.clear();
word_end_or_soft = 0; word_end_or_soft = 0;
// move character that goes outside the box to the next line // move character that goes outside the box to the next line
if (!hide_breaker && line.positions.size() > 2) { if (word_too_long && line.positions.size() > 2) {
line.positions.pop_back(); line.positions.pop_back();
word_start = i; word_start = i;
word_size = add_horizontal(word_size, c.size); word_size = add_horizontal(word_size, c.size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment