mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
LibWeb: Convert Layout::Node to new pixel units
This commit is contained in:
parent
65cdf89a8b
commit
5d8e3f5122
Notes:
sideshowbarker
2024-07-17 02:08:36 +09:00
Author: https://github.com/AtkinsSJ
Commit: 5d8e3f5122
Pull-request: https://github.com/SerenityOS/serenity/pull/16514
Reviewed-by: https://github.com/MacDue
Reviewed-by: https://github.com/linusg ✅
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