1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:58:12 +00:00

LibWeb: Fix off-by-one when computing available space between floats

Whoops, this explains why things were not lining up correctly. :^)
This commit is contained in:
Andreas Kling 2020-12-05 22:49:13 +01:00
parent 2e5e4be212
commit 2f38d94c70
3 changed files with 6 additions and 6 deletions

View file

@ -129,7 +129,7 @@ void ReplacedBox::split_into_lines(InlineFormattingContext& context, LayoutMode)
auto height = calculate_height();
auto* line_box = &containing_block.ensure_last_line_box();
if (line_box->width() > 0 && line_box->width() + width > context.available_width_at_line(containing_block.line_boxes().size()))
if (line_box->width() > 0 && line_box->width() + width > context.available_width_at_line(containing_block.line_boxes().size() - 1))
line_box = &containing_block.add_line_box();
line_box->add_fragment(*this, 0, 0, width, height);
}