1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:57:44 +00:00

LibHTML: Add some convenient geometry getters on LayoutNode

Add x(), y(), size() and position() and use them around the codebase.
This commit is contained in:
Andreas Kling 2019-10-13 17:31:58 +02:00
parent aefc7f9b22
commit 3309bdf722
7 changed files with 26 additions and 22 deletions

View file

@ -28,8 +28,12 @@ public:
Rect& rect() { return m_rect; }
void set_rect(const Rect& rect) { m_rect = rect; }
int x() const { return rect().x(); }
int y() const { return rect().y(); }
int width() const { return rect().width(); }
int height() const { return rect().height(); }
Size size() const { return rect().size(); }
Point position() const { return rect().location(); }
BoxModelMetrics& box_model() { return m_box_metrics; }
const BoxModelMetrics& box_model() const { return m_box_metrics; }