Generated lines should *always* include their end spaces, there should be no gaps.

This commit is contained in:
David Wendt 2020-06-01 21:51:22 -04:00
parent ab2b9cc733
commit 50a05df998
1 changed files with 4 additions and 2 deletions

View File

@ -432,7 +432,9 @@ impl<'gc> LayoutBox<'gc> {
} }
} }
let next_breakpoint = last_breakpoint + breakpoint; // This ensures that the space causing the line break
// is included in the line it broke.
let next_breakpoint = min(last_breakpoint + breakpoint + 1, text.len());
Self::append_text_fragment( Self::append_text_fragment(
context.gc_context, context.gc_context,
@ -443,7 +445,7 @@ impl<'gc> LayoutBox<'gc> {
span, span,
); );
last_breakpoint = next_breakpoint + 1; last_breakpoint = next_breakpoint;
if last_breakpoint >= text.len() { if last_breakpoint >= text.len() {
break; break;
} }