mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
LibGfx: Unpublish FloatPoint from the global namespace
This commit is contained in:
parent
5c2028db24
commit
8bb75084fd
Notes:
sideshowbarker
2024-07-19 09:34:20 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8bb75084fd2
5 changed files with 5 additions and 7 deletions
|
@ -145,5 +145,3 @@ inline const LogStream& operator<<(const LogStream& stream, const FloatPoint& va
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
using Gfx::FloatPoint;
|
||||
|
|
|
@ -212,7 +212,7 @@ HitTestResult LayoutBox::hit_test(const Gfx::Point& position) const
|
|||
// FIXME: It would be nice if we could confidently skip over hit testing
|
||||
// parts of the layout tree, but currently we can't just check
|
||||
// m_rect.contains() since inline text rects can't be trusted..
|
||||
HitTestResult result { m_rect.contains(FloatPoint(position.x(), position.y())) ? this : nullptr };
|
||||
HitTestResult result { m_rect.contains(position.x(), position.y()) ? this : nullptr };
|
||||
for_each_child([&](auto& child) {
|
||||
auto child_result = child.hit_test(position);
|
||||
if (child_result.layout_node)
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
float width() const { return rect().width(); }
|
||||
float height() const { return rect().height(); }
|
||||
Gfx::FloatSize size() const { return rect().size(); }
|
||||
FloatPoint position() const { return rect().location(); }
|
||||
Gfx::FloatPoint position() const { return rect().location(); }
|
||||
|
||||
virtual HitTestResult hit_test(const Gfx::Point& position) const override;
|
||||
virtual void set_needs_display() override;
|
||||
|
|
|
@ -135,12 +135,12 @@ void LayoutNode::set_needs_display()
|
|||
}
|
||||
}
|
||||
|
||||
FloatPoint LayoutNode::box_type_agnostic_position() const
|
||||
Gfx::FloatPoint LayoutNode::box_type_agnostic_position() const
|
||||
{
|
||||
if (is_box())
|
||||
return to<LayoutBox>(*this).position();
|
||||
ASSERT(is_inline());
|
||||
FloatPoint position;
|
||||
Gfx::FloatPoint position;
|
||||
if (auto* block = containing_block()) {
|
||||
block->for_each_fragment([&](auto& fragment) {
|
||||
if (&fragment.layout_node() == this || is_ancestor_of(fragment.layout_node())) {
|
||||
|
|
|
@ -137,7 +137,7 @@ public:
|
|||
template<typename T>
|
||||
T* first_ancestor_of_type();
|
||||
|
||||
FloatPoint box_type_agnostic_position() const;
|
||||
Gfx::FloatPoint box_type_agnostic_position() const;
|
||||
|
||||
protected:
|
||||
explicit LayoutNode(const Node*);
|
||||
|
|
Loading…
Add table
Reference in a new issue