mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +00:00
LibHTML: Don't insert unnecessary line breaks at start of text lines
Basically the same exact fix as I did for replaced elements. There's no point in inserting a line break at the start of a line if all you're trying to achieve is make more horizontal space for something.
This commit is contained in:
parent
884ae80699
commit
8b07025145
1 changed files with 1 additions and 1 deletions
|
@ -180,7 +180,7 @@ void LayoutText::split_into_lines(LayoutBlock& container)
|
|||
else
|
||||
word_width = font.width(word.view) + font.glyph_spacing();
|
||||
|
||||
if (word_width > available_width) {
|
||||
if (line_boxes.last().width() > 0 && word_width > available_width) {
|
||||
line_boxes.append(LineBox());
|
||||
available_width = container.width();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue