mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-20 01:52:53 +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
Notes:
sideshowbarker
2024-07-19 11:42:04 +09:00
Author: https://github.com/awesomekling
Commit: 3309bdf722
7 changed files with 26 additions and 22 deletions
|
@ -61,17 +61,17 @@ void dump_tree(const LayoutNode& layout_node)
|
|||
dbgprintf("%s {%s} at (%d,%d) size %dx%d",
|
||||
layout_node.class_name(),
|
||||
tag_name.characters(),
|
||||
layout_node.rect().x(),
|
||||
layout_node.rect().y(),
|
||||
layout_node.rect().width(),
|
||||
layout_node.rect().height());
|
||||
layout_node.x(),
|
||||
layout_node.y(),
|
||||
layout_node.width(),
|
||||
layout_node.height());
|
||||
|
||||
// Dump the horizontal box properties
|
||||
dbgprintf(" [%d+%d+%d %d %d+%d+%d]",
|
||||
layout_node.box_model().margin().left.to_px(),
|
||||
layout_node.box_model().border().left.to_px(),
|
||||
layout_node.box_model().padding().left.to_px(),
|
||||
layout_node.rect().width(),
|
||||
layout_node.width(),
|
||||
layout_node.box_model().padding().right.to_px(),
|
||||
layout_node.box_model().border().right.to_px(),
|
||||
layout_node.box_model().margin().right.to_px());
|
||||
|
@ -81,7 +81,7 @@ void dump_tree(const LayoutNode& layout_node)
|
|||
layout_node.box_model().margin().top.to_px(),
|
||||
layout_node.box_model().border().top.to_px(),
|
||||
layout_node.box_model().padding().top.to_px(),
|
||||
layout_node.rect().height(),
|
||||
layout_node.height(),
|
||||
layout_node.box_model().padding().bottom.to_px(),
|
||||
layout_node.box_model().border().bottom.to_px(),
|
||||
layout_node.box_model().margin().bottom.to_px());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue