mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +00:00
LibWeb: Fix floating boxes getting stacked on top of each other
This was caused by the freestanding margin_box_rect() using 0 for the content height instead of the actual content height.
This commit is contained in:
parent
89d0cb0ce2
commit
5a770f2eff
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ void FormattingState::commit()
|
||||||
Gfx::FloatRect margin_box_rect(Box const& box, FormattingState const& state)
|
Gfx::FloatRect margin_box_rect(Box const& box, FormattingState const& state)
|
||||||
{
|
{
|
||||||
auto const& box_state = state.get(box);
|
auto const& box_state = state.get(box);
|
||||||
auto rect = Gfx::FloatRect { box_state.offset, { box_state.content_width, 0 } };
|
auto rect = Gfx::FloatRect { box_state.offset, { box_state.content_width, box_state.content_height } };
|
||||||
rect.set_x(rect.x() - box_state.margin_box_left());
|
rect.set_x(rect.x() - box_state.margin_box_left());
|
||||||
rect.set_width(rect.width() + box_state.margin_box_left() + box_state.margin_box_right());
|
rect.set_width(rect.width() + box_state.margin_box_left() + box_state.margin_box_right());
|
||||||
rect.set_y(rect.y() - box_state.margin_box_top());
|
rect.set_y(rect.y() - box_state.margin_box_top());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue