text: Reset max font size on newline

Before this patch, max font size (which claimed to be the highest font
size observed within the current line) was calculated for each span,
regardless of newlines.
This commit is contained in:
Kamil Jarosz 2024-07-31 09:45:43 +02:00
parent fcbeb92406
commit 8722642ed7
1 changed files with 2 additions and 0 deletions

View File

@ -418,6 +418,7 @@ impl<'a, 'gc> LayoutContext<'a, 'gc> {
self.is_first_line = true;
self.has_line_break = true;
self.max_font_size = Twips::from_pixels(self.current_line_span.font.size);
}
/// Adjust the text layout cursor down to the next line.
@ -446,6 +447,7 @@ impl<'a, 'gc> LayoutContext<'a, 'gc> {
self.is_first_line = false;
self.has_line_break = true;
self.max_font_size = Twips::from_pixels(self.current_line_span.font.size);
}
/// Adjust the text layout cursor in response to a tab.