1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:47:35 +00:00

LibWeb: Store bottom edge location with each LineBox

Previously we were computing the bottom edge of a line box by finding
the bottommost fragment on the line.

That method didn't give correct results for line boxes with no fragments
(which is exactly what you get when inserting a bunch of <br> elements.)

To cover all situations, we now keep track of the bottommost edge in the
LineBox object itself.
This commit is contained in:
Andreas Kling 2022-02-27 13:34:34 +01:00
parent 4b6295e667
commit c6cf240f9a
4 changed files with 11 additions and 8 deletions

View file

@ -16,6 +16,7 @@ public:
LineBox() { }
float width() const { return m_width; }
float bottom() const { return m_bottom; }
void add_fragment(Node const& layout_node, int start, int length, float leading_size, float trailing_size, float content_width, float content_height, float border_box_top, float border_box_bottom, LineBoxFragment::Type = LineBoxFragment::Type::Normal);
@ -34,6 +35,7 @@ private:
Vector<LineBoxFragment> m_fragments;
float m_width { 0 };
float m_bottom { 0 };
};
}