mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:47:35 +00:00
LibWeb: Convert Layout::Node to new pixel units
This commit is contained in:
parent
65cdf89a8b
commit
5d8e3f5122
7 changed files with 18 additions and 18 deletions
|
@ -164,16 +164,16 @@ void Node::set_needs_display()
|
|||
});
|
||||
}
|
||||
|
||||
Gfx::FloatPoint Node::box_type_agnostic_position() const
|
||||
CSSPixelPoint Node::box_type_agnostic_position() const
|
||||
{
|
||||
if (is<Box>(*this))
|
||||
return verify_cast<Box>(*this).paint_box()->absolute_position().to_type<float>();
|
||||
return verify_cast<Box>(*this).paint_box()->absolute_position();
|
||||
VERIFY(is_inline());
|
||||
Gfx::FloatPoint position;
|
||||
CSSPixelPoint position;
|
||||
if (auto* block = containing_block()) {
|
||||
block->paint_box()->for_each_fragment([&](auto& fragment) {
|
||||
if (&fragment.layout_node() == this || is_ancestor_of(fragment.layout_node())) {
|
||||
position = fragment.absolute_rect().location().template to_type<float>();
|
||||
position = fragment.absolute_rect().location();
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue