Skip to content

Commit

Permalink
Fix text layout bug added in #1291
Browse files Browse the repository at this point in the history
Using `max_rows == 0` as a special case was a bad idea.
  • Loading branch information
emilk committed Apr 9, 2022
1 parent 2d21b35 commit 5cf1b6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion epaint/src/text/text_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ fn line_break(
}

if row_start_idx < paragraph.glyphs.len() {
if non_empty_rows == job.wrap.max_rows {
if job.wrap.max_rows > 0 && non_empty_rows == job.wrap.max_rows {
if let Some(last_row) = out_rows.last_mut() {
replace_last_glyph_with_overflow_character(fonts, job, last_row);
}
Expand Down

0 comments on commit 5cf1b6e

Please sign in to comment.