mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:57:44 +00:00
Meta+Userland: Pass Gfx::FloatPoint by value
Just a small 8-byte value like Gfx::IntPoint.
This commit is contained in:
parent
7be0b27dd3
commit
e011eafd37
25 changed files with 106 additions and 106 deletions
|
@ -27,7 +27,7 @@ bool BlockContainer::is_scrollable() const
|
|||
return computed_values().overflow_y() == CSS::Overflow::Scroll;
|
||||
}
|
||||
|
||||
void BlockContainer::set_scroll_offset(Gfx::FloatPoint const& offset)
|
||||
void BlockContainer::set_scroll_offset(Gfx::FloatPoint offset)
|
||||
{
|
||||
// FIXME: If there is horizontal and vertical scroll ignore only part of the new offset
|
||||
if (offset.y() < 0 || m_scroll_offset == offset)
|
||||
|
|
|
@ -26,8 +26,8 @@ public:
|
|||
BlockContainer const* next_sibling() const { return verify_cast<BlockContainer>(Node::next_sibling()); }
|
||||
|
||||
bool is_scrollable() const;
|
||||
Gfx::FloatPoint const& scroll_offset() const { return m_scroll_offset; }
|
||||
void set_scroll_offset(Gfx::FloatPoint const&);
|
||||
Gfx::FloatPoint scroll_offset() const { return m_scroll_offset; }
|
||||
void set_scroll_offset(Gfx::FloatPoint);
|
||||
|
||||
Painting::PaintableWithLines const* paint_box() const;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
Trailing,
|
||||
};
|
||||
|
||||
LineBoxFragment(Node const& layout_node, int start, int length, Gfx::FloatPoint const& offset, Gfx::FloatSize const& size, float border_box_top, float border_box_bottom, Type type)
|
||||
LineBoxFragment(Node const& layout_node, int start, int length, Gfx::FloatPoint offset, Gfx::FloatSize const& size, float border_box_top, float border_box_bottom, Type type)
|
||||
: m_layout_node(layout_node)
|
||||
, m_start(start)
|
||||
, m_length(length)
|
||||
|
@ -40,8 +40,8 @@ public:
|
|||
const Gfx::FloatRect absolute_rect() const;
|
||||
Type type() const { return m_type; }
|
||||
|
||||
Gfx::FloatPoint const& offset() const { return m_offset; }
|
||||
void set_offset(Gfx::FloatPoint const& offset) { m_offset = offset; }
|
||||
Gfx::FloatPoint offset() const { return m_offset; }
|
||||
void set_offset(Gfx::FloatPoint offset) { m_offset = offset; }
|
||||
|
||||
// The baseline of a fragment is the number of pixels from the top to the text baseline.
|
||||
void set_baseline(float y) { m_baseline = y; }
|
||||
|
|
|
@ -41,7 +41,7 @@ bool Paintable::handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint, unsigned,
|
|||
return false;
|
||||
}
|
||||
|
||||
Optional<HitTestResult> Paintable::hit_test(Gfx::FloatPoint const&, HitTestType) const
|
||||
Optional<HitTestResult> Paintable::hit_test(Gfx::FloatPoint, HitTestType) const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
virtual void before_children_paint(PaintContext&, PaintPhase) const { }
|
||||
virtual void after_children_paint(PaintContext&, PaintPhase) const { }
|
||||
|
||||
virtual Optional<HitTestResult> hit_test(Gfx::FloatPoint const&, HitTestType) const;
|
||||
virtual Optional<HitTestResult> hit_test(Gfx::FloatPoint, HitTestType) const;
|
||||
|
||||
virtual bool wants_mouse_events() const { return false; }
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ PaintableWithLines::~PaintableWithLines()
|
|||
{
|
||||
}
|
||||
|
||||
void PaintableBox::set_offset(Gfx::FloatPoint const& offset)
|
||||
void PaintableBox::set_offset(Gfx::FloatPoint offset)
|
||||
{
|
||||
m_offset = offset;
|
||||
// FIXME: This const_cast is gross.
|
||||
|
@ -655,7 +655,7 @@ void PaintableBox::set_stacking_context(NonnullOwnPtr<StackingContext> stacking_
|
|||
m_stacking_context = move(stacking_context);
|
||||
}
|
||||
|
||||
Optional<HitTestResult> PaintableBox::hit_test(Gfx::FloatPoint const& position, HitTestType type) const
|
||||
Optional<HitTestResult> PaintableBox::hit_test(Gfx::FloatPoint position, HitTestType type) const
|
||||
{
|
||||
if (!is_visible())
|
||||
return {};
|
||||
|
@ -679,7 +679,7 @@ Optional<HitTestResult> PaintableBox::hit_test(Gfx::FloatPoint const& position,
|
|||
return HitTestResult { *this };
|
||||
}
|
||||
|
||||
Optional<HitTestResult> PaintableWithLines::hit_test(Gfx::FloatPoint const& position, HitTestType type) const
|
||||
Optional<HitTestResult> PaintableWithLines::hit_test(Gfx::FloatPoint position, HitTestType type) const
|
||||
{
|
||||
if (!layout_box().children_are_inline())
|
||||
return PaintableBox::hit_test(position, type);
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
Gfx::FloatRect absolute_rect() const;
|
||||
Gfx::FloatPoint effective_offset() const;
|
||||
|
||||
void set_offset(Gfx::FloatPoint const&);
|
||||
void set_offset(Gfx::FloatPoint);
|
||||
void set_offset(float x, float y) { set_offset({ x, y }); }
|
||||
|
||||
Gfx::FloatSize const& content_size() const { return m_content_size; }
|
||||
|
@ -115,7 +115,7 @@ public:
|
|||
virtual void before_children_paint(PaintContext&, PaintPhase) const override;
|
||||
virtual void after_children_paint(PaintContext&, PaintPhase) const override;
|
||||
|
||||
virtual Optional<HitTestResult> hit_test(Gfx::FloatPoint const&, HitTestType) const override;
|
||||
virtual Optional<HitTestResult> hit_test(Gfx::FloatPoint, HitTestType) const override;
|
||||
|
||||
void invalidate_stacking_context();
|
||||
|
||||
|
@ -190,7 +190,7 @@ public:
|
|||
virtual bool wants_mouse_events() const override { return false; }
|
||||
virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) override;
|
||||
|
||||
virtual Optional<HitTestResult> hit_test(Gfx::FloatPoint const&, HitTestType) const override;
|
||||
virtual Optional<HitTestResult> hit_test(Gfx::FloatPoint, HitTestType) const override;
|
||||
|
||||
protected:
|
||||
PaintableWithLines(Layout::BlockContainer const&);
|
||||
|
|
|
@ -56,7 +56,7 @@ void SVGGeometryPaintable::paint(PaintContext& context, PaintPhase phase) const
|
|||
auto scaling = layout_box().viewbox_scaling();
|
||||
auto origin = layout_box().viewbox_origin();
|
||||
|
||||
auto transform_point = [&scaling, &origin](Gfx::FloatPoint const& point) -> Gfx::FloatPoint {
|
||||
auto transform_point = [&scaling, &origin](Gfx::FloatPoint point) -> Gfx::FloatPoint {
|
||||
auto new_point = point;
|
||||
new_point.translate_by({ -origin.x(), -origin.y() });
|
||||
new_point.scale_by(scaling);
|
||||
|
|
|
@ -439,7 +439,7 @@ static TraversalDecision for_each_in_subtree_of_type_within_same_stacking_contex
|
|||
return TraversalDecision::Continue;
|
||||
}
|
||||
|
||||
Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint const& position, HitTestType type) const
|
||||
Optional<HitTestResult> StackingContext::hit_test(Gfx::FloatPoint position, HitTestType type) const
|
||||
{
|
||||
if (!m_box.is_visible())
|
||||
return {};
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
|
||||
void paint_descendants(PaintContext&, Layout::Node const&, StackingContextPaintPhase) const;
|
||||
void paint(PaintContext&) const;
|
||||
Optional<HitTestResult> hit_test(Gfx::FloatPoint const&, HitTestType) const;
|
||||
Optional<HitTestResult> hit_test(Gfx::FloatPoint, HitTestType) const;
|
||||
|
||||
Gfx::FloatMatrix4x4 const& transform_matrix() const { return m_transform; }
|
||||
Gfx::AffineTransform affine_transform_matrix() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue