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:
parent
aefc7f9b22
commit
3309bdf722
7 changed files with 26 additions and 22 deletions
|
@ -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; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue