mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 17:37:34 +00:00
LibWeb: Include padding+border in shrink-to-fit preferred min width
This commit is contained in:
parent
5a57f618ad
commit
a3acbf1db2
2 changed files with 7 additions and 1 deletions
|
@ -52,6 +52,12 @@ public:
|
||||||
float width() const { return m_size.width(); }
|
float width() const { return m_size.width(); }
|
||||||
float height() const { return m_size.height(); }
|
float height() const { return m_size.height(); }
|
||||||
|
|
||||||
|
float border_box_width() const
|
||||||
|
{
|
||||||
|
auto border_box = box_model().border_box(*this);
|
||||||
|
return width() + border_box.left + border_box.right;
|
||||||
|
}
|
||||||
|
|
||||||
float absolute_x() const { return absolute_rect().x(); }
|
float absolute_x() const { return absolute_rect().x(); }
|
||||||
float absolute_y() const { return absolute_rect().y(); }
|
float absolute_y() const { return absolute_rect().y(); }
|
||||||
Gfx::FloatPoint absolute_position() const { return absolute_rect().location(); }
|
Gfx::FloatPoint absolute_position() const { return absolute_rect().location(); }
|
||||||
|
|
|
@ -96,7 +96,7 @@ static float greatest_child_width(const Box& box)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
box.for_each_child_of_type<Box>([&](auto& child) {
|
box.for_each_child_of_type<Box>([&](auto& child) {
|
||||||
max_width = max(max_width, child.width());
|
max_width = max(max_width, child.border_box_width());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return max_width;
|
return max_width;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue