mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 14:35:08 +00:00
LibHTML: Use floating point numbers throughout the layout tree
This commit is contained in:
parent
da23864c8d
commit
c628ebda0f
15 changed files with 59 additions and 52 deletions
|
@ -109,16 +109,16 @@ void LayoutNode::set_needs_display()
|
|||
}
|
||||
}
|
||||
|
||||
Point LayoutNode::box_type_agnostic_position() const
|
||||
FloatPoint LayoutNode::box_type_agnostic_position() const
|
||||
{
|
||||
if (is_box())
|
||||
return to<LayoutBox>(*this).position();
|
||||
ASSERT(is_inline());
|
||||
Point position;
|
||||
FloatPoint position;
|
||||
if (auto* block = containing_block()) {
|
||||
block->for_each_fragment([&](auto& fragment) {
|
||||
if (&fragment.layout_node() == this || is_ancestor_of(fragment.layout_node())) {
|
||||
position = enclosing_int_rect(fragment.rect()).location();
|
||||
position = fragment.rect().location();
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue