summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2022-12-06 20:57:07 +0000
committerAndreas Kling <kling@serenityos.org>2022-12-07 11:48:27 +0100
commite011eafd3790ca0375a4678a9cb2debd0ae95ac7 (patch)
tree0a0b3a8131a2a61befe85aa841e32958bd53c50d
parent7be0b27dd3cd7185c1b8dc52747c50aad479bc6a (diff)
downloadserenity-e011eafd3790ca0375a4678a9cb2debd0ae95ac7.zip
Meta+Userland: Pass Gfx::FloatPoint by value
Just a small 8-byte value like Gfx::IntPoint.
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp2
-rw-r--r--Userland/Applications/PixelPaint/Tools/PolygonalSelectTool.cpp2
-rw-r--r--Userland/Applications/PixelPaint/Tools/PolygonalSelectTool.h2
-rw-r--r--Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp2
-rw-r--r--Userland/Applications/PixelPaint/Tools/RectangleSelectTool.h2
-rw-r--r--Userland/Applications/PixelPaint/Tools/Tool.h2
-rw-r--r--Userland/Libraries/LibGUI/AbstractZoomPanWidget.h2
-rw-r--r--Userland/Libraries/LibGfx/AffineTransform.cpp8
-rw-r--r--Userland/Libraries/LibGfx/AffineTransform.h8
-rw-r--r--Userland/Libraries/LibGfx/AntiAliasingPainter.cpp24
-rw-r--r--Userland/Libraries/LibGfx/AntiAliasingPainter.h16
-rw-r--r--Userland/Libraries/LibGfx/Painter.cpp36
-rw-r--r--Userland/Libraries/LibGfx/Painter.h16
-rw-r--r--Userland/Libraries/LibGfx/Path.cpp18
-rw-r--r--Userland/Libraries/LibGfx/Path.h38
-rw-r--r--Userland/Libraries/LibWeb/Layout/BlockContainer.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Layout/BlockContainer.h4
-rw-r--r--Userland/Libraries/LibWeb/Layout/LineBoxFragment.h6
-rw-r--r--Userland/Libraries/LibWeb/Painting/Paintable.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Painting/Paintable.h2
-rw-r--r--Userland/Libraries/LibWeb/Painting/PaintableBox.cpp6
-rw-r--r--Userland/Libraries/LibWeb/Painting/PaintableBox.h6
-rw-r--r--Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Painting/StackingContext.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Painting/StackingContext.h2
25 files changed, 106 insertions, 106 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp
index 27b94ff15e..e6f583076c 100644
--- a/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/IPCCompiler/main.cpp
@@ -69,7 +69,7 @@ static bool is_primitive_type(DeprecatedString const& type)
static bool is_simple_type(DeprecatedString const& type)
{
// Small types that it makes sense just to pass by value.
- return type.is_one_of("Gfx::Color", "Gfx::IntPoint");
+ return type.is_one_of("Gfx::Color", "Gfx::IntPoint", "Gfx::FloatPoint");
}
static bool is_primitive_or_simple_type(DeprecatedString const& type)
diff --git a/Userland/Applications/PixelPaint/Tools/PolygonalSelectTool.cpp b/Userland/Applications/PixelPaint/Tools/PolygonalSelectTool.cpp
index 919110793c..672b4aa3a4 100644
--- a/Userland/Applications/PixelPaint/Tools/PolygonalSelectTool.cpp
+++ b/Userland/Applications/PixelPaint/Tools/PolygonalSelectTool.cpp
@@ -218,7 +218,7 @@ GUI::Widget* PolygonalSelectTool::get_properties_widget()
return m_properties_widget.ptr();
}
-Gfx::IntPoint PolygonalSelectTool::point_position_to_preferred_cell(Gfx::FloatPoint const& position) const
+Gfx::IntPoint PolygonalSelectTool::point_position_to_preferred_cell(Gfx::FloatPoint position) const
{
return position.to_type<int>();
}
diff --git a/Userland/Applications/PixelPaint/Tools/PolygonalSelectTool.h b/Userland/Applications/PixelPaint/Tools/PolygonalSelectTool.h
index f5300cdbce..0b0a87c6bc 100644
--- a/Userland/Applications/PixelPaint/Tools/PolygonalSelectTool.h
+++ b/Userland/Applications/PixelPaint/Tools/PolygonalSelectTool.h
@@ -24,7 +24,7 @@ public:
virtual void on_second_paint(Layer const*, GUI::PaintEvent&) override;
virtual GUI::Widget* get_properties_widget() override;
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() override { return Gfx::StandardCursor::Crosshair; }
- virtual Gfx::IntPoint point_position_to_preferred_cell(Gfx::FloatPoint const& position) const override;
+ virtual Gfx::IntPoint point_position_to_preferred_cell(Gfx::FloatPoint position) const override;
private:
virtual void flood_polygon_selection(Gfx::Bitmap&, Gfx::IntPoint);
diff --git a/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp b/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp
index ab39950680..d62ad2d1d2 100644
--- a/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp
+++ b/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp
@@ -217,7 +217,7 @@ GUI::Widget* RectangleSelectTool::get_properties_widget()
return m_properties_widget.ptr();
}
-Gfx::IntPoint RectangleSelectTool::point_position_to_preferred_cell(Gfx::FloatPoint const& position) const
+Gfx::IntPoint RectangleSelectTool::point_position_to_preferred_cell(Gfx::FloatPoint position) const
{
return position.to_rounded<int>();
}
diff --git a/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.h b/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.h
index b93dc5d8f6..3034ece808 100644
--- a/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.h
+++ b/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.h
@@ -28,7 +28,7 @@ public:
virtual void on_second_paint(Layer const*, GUI::PaintEvent&) override;
virtual GUI::Widget* get_properties_widget() override;
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() override { return Gfx::StandardCursor::Crosshair; }
- virtual Gfx::IntPoint point_position_to_preferred_cell(Gfx::FloatPoint const& position) const override;
+ virtual Gfx::IntPoint point_position_to_preferred_cell(Gfx::FloatPoint position) const override;
private:
virtual StringView tool_name() const override { return "Rectangle Select Tool"sv; }
diff --git a/Userland/Applications/PixelPaint/Tools/Tool.h b/Userland/Applications/PixelPaint/Tools/Tool.h
index e243c41eeb..0662e46f80 100644
--- a/Userland/Applications/PixelPaint/Tools/Tool.h
+++ b/Userland/Applications/PixelPaint/Tools/Tool.h
@@ -66,7 +66,7 @@ public:
virtual void on_tool_activation() { }
virtual GUI::Widget* get_properties_widget() { return nullptr; }
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() { return Gfx::StandardCursor::None; }
- virtual Gfx::IntPoint point_position_to_preferred_cell(Gfx::FloatPoint const& position) const { return position.to_type<int>(); }
+ virtual Gfx::IntPoint point_position_to_preferred_cell(Gfx::FloatPoint position) const { return position.to_type<int>(); }
void clear() { m_editor = nullptr; }
void setup(ImageEditor&);
diff --git a/Userland/Libraries/LibGUI/AbstractZoomPanWidget.h b/Userland/Libraries/LibGUI/AbstractZoomPanWidget.h
index c2d53cb89e..4de8f29a33 100644
--- a/Userland/Libraries/LibGUI/AbstractZoomPanWidget.h
+++ b/Userland/Libraries/LibGUI/AbstractZoomPanWidget.h
@@ -46,7 +46,7 @@ public:
void set_original_rect(Gfx::IntRect const& rect) { m_original_rect = rect; }
void set_content_rect(Gfx::IntRect const& content_rect);
- void set_origin(Gfx::FloatPoint const& origin) { m_origin = origin; }
+ void set_origin(Gfx::FloatPoint origin) { m_origin = origin; }
void reset_view();
diff --git a/Userland/Libraries/LibGfx/AffineTransform.cpp b/Userland/Libraries/LibGfx/AffineTransform.cpp
index 65ef067329..61c4ca63d5 100644
--- a/Userland/Libraries/LibGfx/AffineTransform.cpp
+++ b/Userland/Libraries/LibGfx/AffineTransform.cpp
@@ -60,7 +60,7 @@ AffineTransform& AffineTransform::scale(float sx, float sy)
return *this;
}
-AffineTransform& AffineTransform::scale(FloatPoint const& s)
+AffineTransform& AffineTransform::scale(FloatPoint s)
{
return scale(s.x(), s.y());
}
@@ -74,7 +74,7 @@ AffineTransform& AffineTransform::set_scale(float sx, float sy)
return *this;
}
-AffineTransform& AffineTransform::set_scale(FloatPoint const& s)
+AffineTransform& AffineTransform::set_scale(FloatPoint s)
{
return set_scale(s.x(), s.y());
}
@@ -86,7 +86,7 @@ AffineTransform& AffineTransform::translate(float tx, float ty)
return *this;
}
-AffineTransform& AffineTransform::translate(FloatPoint const& t)
+AffineTransform& AffineTransform::translate(FloatPoint t)
{
return translate(t.x(), t.y());
}
@@ -98,7 +98,7 @@ AffineTransform& AffineTransform::set_translation(float tx, float ty)
return *this;
}
-AffineTransform& AffineTransform::set_translation(FloatPoint const& t)
+AffineTransform& AffineTransform::set_translation(FloatPoint t)
{
return set_translation(t.x(), t.y());
}
diff --git a/Userland/Libraries/LibGfx/AffineTransform.h b/Userland/Libraries/LibGfx/AffineTransform.h
index d60b19b10c..a033f922e4 100644
--- a/Userland/Libraries/LibGfx/AffineTransform.h
+++ b/Userland/Libraries/LibGfx/AffineTransform.h
@@ -56,13 +56,13 @@ public:
[[nodiscard]] FloatPoint translation() const;
AffineTransform& scale(float sx, float sy);
- AffineTransform& scale(FloatPoint const& s);
+ AffineTransform& scale(FloatPoint s);
AffineTransform& set_scale(float sx, float sy);
- AffineTransform& set_scale(FloatPoint const& s);
+ AffineTransform& set_scale(FloatPoint s);
AffineTransform& translate(float tx, float ty);
- AffineTransform& translate(FloatPoint const& t);
+ AffineTransform& translate(FloatPoint t);
AffineTransform& set_translation(float tx, float ty);
- AffineTransform& set_translation(FloatPoint const& t);
+ AffineTransform& set_translation(FloatPoint t);
AffineTransform& rotate_radians(float);
AffineTransform& multiply(AffineTransform const&);
diff --git a/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp b/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp
index 3bf87d0cac..de9bab82ed 100644
--- a/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp
+++ b/Userland/Libraries/LibGfx/AntiAliasingPainter.cpp
@@ -154,7 +154,7 @@ void AntiAliasingPainter::draw_anti_aliased_line(FloatPoint actual_from, FloatPo
}
}
-void AntiAliasingPainter::draw_line_for_path(FloatPoint const& actual_from, FloatPoint const& actual_to, Color color, float thickness, Painter::LineStyle style, Color alternate_color, LineLengthMode line_length_mode)
+void AntiAliasingPainter::draw_line_for_path(FloatPoint actual_from, FloatPoint actual_to, Color color, float thickness, Painter::LineStyle style, Color alternate_color, LineLengthMode line_length_mode)
{
draw_anti_aliased_line<FixmeEnableHacksForBetterPathPainting::Yes>(actual_from, actual_to, color, thickness, style, alternate_color, line_length_mode);
}
@@ -201,7 +201,7 @@ void AntiAliasingPainter::draw_dotted_line(IntPoint point1, IntPoint point2, Col
}
}
-void AntiAliasingPainter::draw_line(FloatPoint const& actual_from, FloatPoint const& actual_to, Color color, float thickness, Painter::LineStyle style, Color alternate_color, LineLengthMode line_length_mode)
+void AntiAliasingPainter::draw_line(FloatPoint actual_from, FloatPoint actual_to, Color color, float thickness, Painter::LineStyle style, Color alternate_color, LineLengthMode line_length_mode)
{
if (style == Painter::LineStyle::Dotted)
return draw_dotted_line(actual_from.to_rounded<int>(), actual_to.to_rounded<int>(), color, static_cast<int>(round(thickness)));
@@ -240,15 +240,15 @@ void AntiAliasingPainter::stroke_path(Path const& path, Color color, float thick
cursor = segment.point();
break;
case Segment::Type::QuadraticBezierCurveTo: {
- auto& through = static_cast<QuadraticBezierCurveSegment const&>(segment).through();
+ auto through = static_cast<QuadraticBezierCurveSegment const&>(segment).through();
draw_quadratic_bezier_curve(through, cursor, segment.point(), color, thickness);
cursor = segment.point();
break;
}
case Segment::Type::CubicBezierCurveTo: {
auto& curve = static_cast<CubicBezierCurveSegment const&>(segment);
- auto& through_0 = curve.through_0();
- auto& through_1 = curve.through_1();
+ auto through_0 = curve.through_0();
+ auto through_1 = curve.through_1();
draw_cubic_bezier_curve(through_0, through_1, cursor, segment.point(), color, thickness);
cursor = segment.point();
break;
@@ -268,23 +268,23 @@ void AntiAliasingPainter::stroke_path(Path const& path, Color color, float thick
stroke_segment_intersection(first_line.value().a(), first_line.value().b(), last_line, color, thickness);
}
-void AntiAliasingPainter::draw_elliptical_arc(FloatPoint const& p1, FloatPoint const& p2, FloatPoint const& center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color color, float thickness, Painter::LineStyle style)
+void AntiAliasingPainter::draw_elliptical_arc(FloatPoint p1, FloatPoint p2, FloatPoint center, FloatPoint radii, float x_axis_rotation, float theta_1, float theta_delta, Color color, float thickness, Painter::LineStyle style)
{
- Painter::for_each_line_segment_on_elliptical_arc(p1, p2, center, radii, x_axis_rotation, theta_1, theta_delta, [&](FloatPoint const& fp1, FloatPoint const& fp2) {
+ Painter::for_each_line_segment_on_elliptical_arc(p1, p2, center, radii, x_axis_rotation, theta_1, theta_delta, [&](FloatPoint fp1, FloatPoint fp2) {
draw_line_for_path(fp1, fp2, color, thickness, style);
});
}
-void AntiAliasingPainter::draw_quadratic_bezier_curve(FloatPoint const& control_point, FloatPoint const& p1, FloatPoint const& p2, Color color, float thickness, Painter::LineStyle style)
+void AntiAliasingPainter::draw_quadratic_bezier_curve(FloatPoint control_point, FloatPoint p1, FloatPoint p2, Color color, float thickness, Painter::LineStyle style)
{
- Painter::for_each_line_segment_on_bezier_curve(control_point, p1, p2, [&](FloatPoint const& fp1, FloatPoint const& fp2) {
+ Painter::for_each_line_segment_on_bezier_curve(control_point, p1, p2, [&](FloatPoint fp1, FloatPoint fp2) {
draw_line_for_path(fp1, fp2, color, thickness, style);
});
}
-void AntiAliasingPainter::draw_cubic_bezier_curve(FloatPoint const& control_point_0, FloatPoint const& control_point_1, FloatPoint const& p1, FloatPoint const& p2, Color color, float thickness, Painter::LineStyle style)
+void AntiAliasingPainter::draw_cubic_bezier_curve(FloatPoint control_point_0, FloatPoint control_point_1, FloatPoint p1, FloatPoint p2, Color color, float thickness, Painter::LineStyle style)
{
- Painter::for_each_line_segment_on_cubic_bezier_curve(control_point_0, control_point_1, p1, p2, [&](FloatPoint const& fp1, FloatPoint const& fp2) {
+ Painter::for_each_line_segment_on_cubic_bezier_curve(control_point_0, control_point_1, p1, p2, [&](FloatPoint fp1, FloatPoint fp2) {
draw_line_for_path(fp1, fp2, color, thickness, style);
});
}
@@ -685,7 +685,7 @@ void AntiAliasingPainter::fill_rect_with_rounded_corners(IntRect const& a_rect,
fill_corner(bottom_right_corner, bounding_rect.bottom_right(), bottom_right);
}
-void AntiAliasingPainter::stroke_segment_intersection(FloatPoint const& current_line_a, FloatPoint const& current_line_b, FloatLine const& previous_line, Color color, float thickness)
+void AntiAliasingPainter::stroke_segment_intersection(FloatPoint current_line_a, FloatPoint current_line_b, FloatLine const& previous_line, Color color, float thickness)
{
// FIXME: This is currently drawn in slightly the wrong place most of the time.
// FIXME: This is sometimes drawn when the intersection would not be visible anyway.
diff --git a/Userland/Libraries/LibGfx/AntiAliasingPainter.h b/Userland/Libraries/LibGfx/AntiAliasingPainter.h
index 35e0513347..67f44eb536 100644
--- a/Userland/Libraries/LibGfx/AntiAliasingPainter.h
+++ b/Userland/Libraries/LibGfx/AntiAliasingPainter.h
@@ -26,21 +26,21 @@ public:
Distance
};
- void draw_line(FloatPoint const&, FloatPoint const&, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid, Color alternate_color = Color::Transparent, LineLengthMode line_length_mode = LineLengthMode::PointToPoint);
- void draw_line_for_path(FloatPoint const&, FloatPoint const&, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid, Color alternate_color = Color::Transparent, LineLengthMode line_length_mode = LineLengthMode::PointToPoint);
- void draw_line_for_fill_path(FloatPoint const& from, FloatPoint const& to, Color color, float thickness = 1)
+ void draw_line(FloatPoint, FloatPoint, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid, Color alternate_color = Color::Transparent, LineLengthMode line_length_mode = LineLengthMode::PointToPoint);
+ void draw_line_for_path(FloatPoint, FloatPoint, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid, Color alternate_color = Color::Transparent, LineLengthMode line_length_mode = LineLengthMode::PointToPoint);
+ void draw_line_for_fill_path(FloatPoint from, FloatPoint to, Color color, float thickness = 1)
{
draw_line_for_path(from, to, color, thickness, Painter::LineStyle::Solid, Color {}, LineLengthMode::Distance);
}
void fill_path(Path&, Color, Painter::WindingRule rule = Painter::WindingRule::Nonzero);
void stroke_path(Path const&, Color, float thickness);
- void draw_quadratic_bezier_curve(FloatPoint const& control_point, FloatPoint const&, FloatPoint const&, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid);
- void draw_cubic_bezier_curve(FloatPoint const& control_point_0, FloatPoint const& control_point_1, FloatPoint const&, FloatPoint const&, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid);
- void draw_elliptical_arc(FloatPoint const& p1, FloatPoint const& p2, FloatPoint const& center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid);
+ void draw_quadratic_bezier_curve(FloatPoint control_point, FloatPoint, FloatPoint, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid);
+ void draw_cubic_bezier_curve(FloatPoint control_point_0, FloatPoint control_point_1, FloatPoint, FloatPoint, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid);
+ void draw_elliptical_arc(FloatPoint p1, FloatPoint p2, FloatPoint center, FloatPoint radii, float x_axis_rotation, float theta_1, float theta_delta, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid);
void translate(float dx, float dy) { m_transform.translate(dx, dy); }
- void translate(FloatPoint const& delta) { m_transform.translate(delta); }
+ void translate(FloatPoint delta) { m_transform.translate(delta); }
void draw_ellipse(IntRect const& a_rect, Color, int thickness);
@@ -97,7 +97,7 @@ private:
template<FixmeEnableHacksForBetterPathPainting path_hacks>
void draw_anti_aliased_line(FloatPoint, FloatPoint, Color, float thickness, Painter::LineStyle style, Color alternate_color, LineLengthMode line_length_mode = LineLengthMode::PointToPoint);
- void stroke_segment_intersection(FloatPoint const& current_line_a, FloatPoint const& current_line_b, FloatLine const& previous_line, Color, float thickness);
+ void stroke_segment_intersection(FloatPoint current_line_a, FloatPoint current_line_b, FloatLine const& previous_line, Color, float thickness);
Painter& m_underlying_painter;
AffineTransform m_transform;
diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp
index e7353c372d..4e47807026 100644
--- a/Userland/Libraries/LibGfx/Painter.cpp
+++ b/Userland/Libraries/LibGfx/Painter.cpp
@@ -2080,7 +2080,7 @@ void Painter::draw_triangle_wave(IntPoint a_p1, IntPoint a_p2, Color color, int
}
}
-static bool can_approximate_bezier_curve(FloatPoint const& p1, FloatPoint const& p2, FloatPoint const& control)
+static bool can_approximate_bezier_curve(FloatPoint p1, FloatPoint p2, FloatPoint control)
{
constexpr float tolerance = 0.0015f;
@@ -2098,7 +2098,7 @@ static bool can_approximate_bezier_curve(FloatPoint const& p1, FloatPoint const&
}
// static
-void Painter::for_each_line_segment_on_bezier_curve(FloatPoint const& control_point, FloatPoint const& p1, FloatPoint const& p2, Function<void(FloatPoint const&, FloatPoint const&)>& callback)
+void Painter::for_each_line_segment_on_bezier_curve(FloatPoint control_point, FloatPoint p1, FloatPoint p2, Function<void(FloatPoint, FloatPoint)>& callback)
{
struct SegmentDescriptor {
FloatPoint control_point;
@@ -2106,7 +2106,7 @@ void Painter::for_each_line_segment_on_bezier_curve(FloatPoint const& control_po
FloatPoint p2;
};
- static constexpr auto split_quadratic_bezier_curve = [](FloatPoint const& original_control, FloatPoint const& p1, FloatPoint const& p2, auto& segments) {
+ static constexpr auto split_quadratic_bezier_curve = [](FloatPoint original_control, FloatPoint p1, FloatPoint p2, auto& segments) {
auto po1_midpoint = original_control + p1;
po1_midpoint /= 2;
@@ -2132,7 +2132,7 @@ void Painter::for_each_line_segment_on_bezier_curve(FloatPoint const& control_po
}
}
-void Painter::for_each_line_segment_on_bezier_curve(FloatPoint const& control_point, FloatPoint const& p1, FloatPoint const& p2, Function<void(FloatPoint const&, FloatPoint const&)>&& callback)
+void Painter::for_each_line_segment_on_bezier_curve(FloatPoint control_point, FloatPoint p1, FloatPoint p2, Function<void(FloatPoint, FloatPoint)>&& callback)
{
for_each_line_segment_on_bezier_curve(control_point, p1, p2, callback);
}
@@ -2144,17 +2144,17 @@ void Painter::draw_quadratic_bezier_curve(IntPoint control_point, IntPoint p1, I
if (thickness <= 0)
return;
- for_each_line_segment_on_bezier_curve(FloatPoint(control_point), FloatPoint(p1), FloatPoint(p2), [&](FloatPoint const& fp1, FloatPoint const& fp2) {
+ for_each_line_segment_on_bezier_curve(FloatPoint(control_point), FloatPoint(p1), FloatPoint(p2), [&](FloatPoint fp1, FloatPoint fp2) {
draw_line(IntPoint(fp1.x(), fp1.y()), IntPoint(fp2.x(), fp2.y()), color, thickness, style);
});
}
-void Painter::for_each_line_segment_on_cubic_bezier_curve(FloatPoint const& control_point_0, FloatPoint const& control_point_1, FloatPoint const& p1, FloatPoint const& p2, Function<void(FloatPoint const&, FloatPoint const&)>&& callback)
+void Painter::for_each_line_segment_on_cubic_bezier_curve(FloatPoint control_point_0, FloatPoint control_point_1, FloatPoint p1, FloatPoint p2, Function<void(FloatPoint, FloatPoint)>&& callback)
{
for_each_line_segment_on_cubic_bezier_curve(control_point_0, control_point_1, p1, p2, callback);
}
-static bool can_approximate_cubic_bezier_curve(FloatPoint const& p1, FloatPoint const& p2, FloatPoint const& control_0, FloatPoint const& control_1)
+static bool can_approximate_cubic_bezier_curve(FloatPoint p1, FloatPoint p2, FloatPoint control_0, FloatPoint control_1)
{
constexpr float tolerance = 0.0015f;
@@ -2172,7 +2172,7 @@ static bool can_approximate_cubic_bezier_curve(FloatPoint const& p1, FloatPoint
}
// static
-void Painter::for_each_line_segment_on_cubic_bezier_curve(FloatPoint const& control_point_0, FloatPoint const& control_point_1, FloatPoint const& p1, FloatPoint const& p2, Function<void(FloatPoint const&, FloatPoint const&)>& callback)
+void Painter::for_each_line_segment_on_cubic_bezier_curve(FloatPoint control_point_0, FloatPoint control_point_1, FloatPoint p1, FloatPoint p2, Function<void(FloatPoint, FloatPoint)>& callback)
{
struct ControlPair {
FloatPoint control_point_0;
@@ -2184,7 +2184,7 @@ void Painter::for_each_line_segment_on_cubic_bezier_curve(FloatPoint const& cont
FloatPoint p2;
};
- static constexpr auto split_cubic_bezier_curve = [](ControlPair const& original_controls, FloatPoint const& p1, FloatPoint const& p2, auto& segments) {
+ static constexpr auto split_cubic_bezier_curve = [](ControlPair const& original_controls, FloatPoint p1, FloatPoint p2, auto& segments) {
Array level_1_midpoints {
(p1 + original_controls.control_point_0) / 2,
(original_controls.control_point_0 + original_controls.control_point_1) / 2,
@@ -2214,13 +2214,13 @@ void Painter::for_each_line_segment_on_cubic_bezier_curve(FloatPoint const& cont
void Painter::draw_cubic_bezier_curve(IntPoint control_point_0, IntPoint control_point_1, IntPoint p1, IntPoint p2, Color color, int thickness, Painter::LineStyle style)
{
- for_each_line_segment_on_cubic_bezier_curve(FloatPoint(control_point_0), FloatPoint(control_point_1), FloatPoint(p1), FloatPoint(p2), [&](FloatPoint const& fp1, FloatPoint const& fp2) {
+ for_each_line_segment_on_cubic_bezier_curve(FloatPoint(control_point_0), FloatPoint(control_point_1), FloatPoint(p1), FloatPoint(p2), [&](FloatPoint fp1, FloatPoint fp2) {
draw_line(IntPoint(fp1.x(), fp1.y()), IntPoint(fp2.x(), fp2.y()), color, thickness, style);
});
}
// static
-void Painter::for_each_line_segment_on_elliptical_arc(FloatPoint const& p1, FloatPoint const& p2, FloatPoint const& center, FloatPoint const radii, float x_axis_rotation, float theta_1, float theta_delta, Function<void(FloatPoint const&, FloatPoint const&)>& callback)
+void Painter::for_each_line_segment_on_elliptical_arc(FloatPoint p1, FloatPoint p2, FloatPoint center, FloatPoint const radii, float x_axis_rotation, float theta_1, float theta_delta, Function<void(FloatPoint, FloatPoint)>& callback)
{
if (radii.x() <= 0 || radii.y() <= 0)
return;
@@ -2272,19 +2272,19 @@ void Painter::for_each_line_segment_on_elliptical_arc(FloatPoint const& p1, Floa
}
// static
-void Painter::for_each_line_segment_on_elliptical_arc(FloatPoint const& p1, FloatPoint const& p2, FloatPoint const& center, FloatPoint const radii, float x_axis_rotation, float theta_1, float theta_delta, Function<void(FloatPoint const&, FloatPoint const&)>&& callback)
+void Painter::for_each_line_segment_on_elliptical_arc(FloatPoint p1, FloatPoint p2, FloatPoint center, FloatPoint const radii, float x_axis_rotation, float theta_1, float theta_delta, Function<void(FloatPoint, FloatPoint)>&& callback)
{
for_each_line_segment_on_elliptical_arc(p1, p2, center, radii, x_axis_rotation, theta_1, theta_delta, callback);
}
-void Painter::draw_elliptical_arc(IntPoint p1, IntPoint p2, IntPoint center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color color, int thickness, LineStyle style)
+void Painter::draw_elliptical_arc(IntPoint p1, IntPoint p2, IntPoint center, FloatPoint radii, float x_axis_rotation, float theta_1, float theta_delta, Color color, int thickness, LineStyle style)
{
VERIFY(scale() == 1); // FIXME: Add scaling support.
if (thickness <= 0)
return;
- for_each_line_segment_on_elliptical_arc(FloatPoint(p1), FloatPoint(p2), FloatPoint(center), radii, x_axis_rotation, theta_1, theta_delta, [&](FloatPoint const& fp1, FloatPoint const& fp2) {
+ for_each_line_segment_on_elliptical_arc(FloatPoint(p1), FloatPoint(p2), FloatPoint(center), radii, x_axis_rotation, theta_1, theta_delta, [&](FloatPoint fp1, FloatPoint fp2) {
draw_line(IntPoint(fp1.x(), fp1.y()), IntPoint(fp2.x(), fp2.y()), color, thickness, style);
});
}
@@ -2333,15 +2333,15 @@ void Painter::stroke_path(Path const& path, Color color, int thickness)
cursor = segment.point();
break;
case Segment::Type::QuadraticBezierCurveTo: {
- auto& through = static_cast<QuadraticBezierCurveSegment const&>(segment).through();
+ auto through = static_cast<QuadraticBezierCurveSegment const&>(segment).through();
draw_quadratic_bezier_curve(through.to_type<int>(), cursor.to_type<int>(), segment.point().to_type<int>(), color, thickness);
cursor = segment.point();
break;
}
case Segment::Type::CubicBezierCurveTo: {
auto& curve = static_cast<CubicBezierCurveSegment const&>(segment);
- auto& through_0 = curve.through_0();
- auto& through_1 = curve.through_1();
+ auto through_0 = curve.through_0();
+ auto through_1 = curve.through_1();
draw_cubic_bezier_curve(through_0.to_type<int>(), through_1.to_type<int>(), cursor.to_type<int>(), segment.point().to_type<int>(), color, thickness);
cursor = segment.point();
break;
@@ -2446,7 +2446,7 @@ void Gfx::Painter::draw_ui_text(Gfx::IntRect const& rect, StringView text, Gfx::
}
}
-void Painter::draw_text_run(FloatPoint const& baseline_start, Utf8View const& string, Font const& font, Color color)
+void Painter::draw_text_run(FloatPoint baseline_start, Utf8View const& string, Font const& font, Color color)
{
auto pixel_metrics = font.pixel_metrics();
float x = baseline_start.x();
diff --git a/Userland/Libraries/LibGfx/Painter.h b/Userland/Libraries/LibGfx/Painter.h
index 863a5c5510..7aaadd38fe 100644
--- a/Userland/Libraries/LibGfx/Painter.h
+++ b/Userland/Libraries/LibGfx/Painter.h
@@ -71,7 +71,7 @@ public:
void draw_triangle_wave(IntPoint, IntPoint, Color color, int amplitude, int thickness = 1);
void draw_quadratic_bezier_curve(IntPoint control_point, IntPoint, IntPoint, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
void draw_cubic_bezier_curve(IntPoint control_point_0, IntPoint control_point_1, IntPoint, IntPoint, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
- void draw_elliptical_arc(IntPoint p1, IntPoint p2, IntPoint center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
+ void draw_elliptical_arc(IntPoint p1, IntPoint p2, IntPoint center, FloatPoint radii, float x_axis_rotation, float theta_1, float theta_delta, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
void blit(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect, float opacity = 1.0f, bool apply_alpha = true);
void blit_dimmed(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect);
void blit_brightened(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect);
@@ -96,7 +96,7 @@ public:
void draw_circle_arc_intersecting(IntRect const&, IntPoint, int radius, Color, int thickness);
// Streamlined text drawing routine that does no wrapping/elision/alignment.
- void draw_text_run(FloatPoint const& baseline_start, Utf8View const&, Font const&, Color);
+ void draw_text_run(FloatPoint baseline_start, Utf8View const&, Font const&, Color);
enum class CornerOrientation {
TopLeft,
@@ -106,14 +106,14 @@ public:
};
void fill_rounded_corner(IntRect const&, int radius, Color, CornerOrientation);
- static void for_each_line_segment_on_bezier_curve(FloatPoint const& control_point, FloatPoint const& p1, FloatPoint const& p2, Function<void(FloatPoint const&, FloatPoint const&)>&);
- static void for_each_line_segment_on_bezier_curve(FloatPoint const& control_point, FloatPoint const& p1, FloatPoint const& p2, Function<void(FloatPoint const&, FloatPoint const&)>&&);
+ static void for_each_line_segment_on_bezier_curve(FloatPoint control_point, FloatPoint p1, FloatPoint p2, Function<void(FloatPoint, FloatPoint)>&);
+ static void for_each_line_segment_on_bezier_curve(FloatPoint control_point, FloatPoint p1, FloatPoint p2, Function<void(FloatPoint, FloatPoint)>&&);
- static void for_each_line_segment_on_cubic_bezier_curve(FloatPoint const& control_point_0, FloatPoint const& control_point_1, FloatPoint const& p1, FloatPoint const& p2, Function<void(FloatPoint const&, FloatPoint const&)>&);
- static void for_each_line_segment_on_cubic_bezier_curve(FloatPoint const& control_point_0, FloatPoint const& control_point_1, FloatPoint const& p1, FloatPoint const& p2, Function<void(FloatPoint const&, FloatPoint const&)>&&);
+ static void for_each_line_segment_on_cubic_bezier_curve(FloatPoint control_point_0, FloatPoint control_point_1, FloatPoint p1, FloatPoint p2, Function<void(FloatPoint, FloatPoint)>&);
+ static void for_each_line_segment_on_cubic_bezier_curve(FloatPoint control_point_0, FloatPoint control_point_1, FloatPoint p1, FloatPoint p2, Function<void(FloatPoint, FloatPoint)>&&);
- static void for_each_line_segment_on_elliptical_arc(FloatPoint const& p1, FloatPoint const& p2, FloatPoint const& center, FloatPoint const radii, float x_axis_rotation, float theta_1, float theta_delta, Function<void(FloatPoint const&, FloatPoint const&)>&);
- static void for_each_line_segment_on_elliptical_arc(FloatPoint const& p1, FloatPoint const& p2, FloatPoint const& center, FloatPoint const radii, float x_axis_rotation, float theta_1, float theta_delta, Function<void(FloatPoint const&, FloatPoint const&)>&&);
+ static void for_each_line_segment_on_elliptical_arc(FloatPoint p1, FloatPoint p2, FloatPoint center, FloatPoint const radii, float x_axis_rotation, float theta_1, float theta_delta, Function<void(FloatPoint, FloatPoint)>&);
+ static void for_each_line_segment_on_elliptical_arc(FloatPoint p1, FloatPoint p2, FloatPoint center, FloatPoint const radii, float x_axis_rotation, float theta_1, float theta_delta, Function<void(FloatPoint, FloatPoint)>&&);
void stroke_path(Path const&, Color, int thickness);
diff --git a/Userland/Libraries/LibGfx/Path.cpp b/Userland/Libraries/LibGfx/Path.cpp
index c95b0458f5..d034aaf275 100644
--- a/Userland/Libraries/LibGfx/Path.cpp
+++ b/Userland/Libraries/LibGfx/Path.cpp
@@ -14,7 +14,7 @@
namespace Gfx {
-void Path::elliptical_arc_to(FloatPoint const& point, FloatPoint const& radii, double x_axis_rotation, bool large_arc, bool sweep)
+void Path::elliptical_arc_to(FloatPoint point, FloatPoint radii, double x_axis_rotation, bool large_arc, bool sweep)
{
auto next_point = point;
@@ -120,7 +120,7 @@ void Path::close()
if (m_segments.size() <= 1)
return;
- auto& last_point = m_segments.last().point();
+ auto last_point = m_segments.last().point();
for (ssize_t i = m_segments.size() - 1; i >= 0; --i) {
auto& segment = m_segments[i];
@@ -243,7 +243,7 @@ void Path::segmentize_path()
float max_x = 0;
float max_y = 0;
- auto add_point_to_bbox = [&](Gfx::FloatPoint const& point) {
+ auto add_point_to_bbox = [&](Gfx::FloatPoint point) {
float x = point.x();
float y = point.y();
min_x = min(min_x, x);
@@ -291,8 +291,8 @@ void Path::segmentize_path()
break;
}
case Segment::Type::QuadraticBezierCurveTo: {
- auto& control = static_cast<QuadraticBezierCurveSegment&>(segment).through();
- Painter::for_each_line_segment_on_bezier_curve(control, cursor, segment.point(), [&](FloatPoint const& p0, FloatPoint const& p1) {
+ auto control = static_cast<QuadraticBezierCurveSegment&>(segment).through();
+ Painter::for_each_line_segment_on_bezier_curve(control, cursor, segment.point(), [&](FloatPoint p0, FloatPoint p1) {
add_line(p0, p1);
});
cursor = segment.point();
@@ -300,9 +300,9 @@ void Path::segmentize_path()
}
case Segment::Type::CubicBezierCurveTo: {
auto& curve = static_cast<CubicBezierCurveSegment const&>(segment);
- auto& control_0 = curve.through_0();
- auto& control_1 = curve.through_1();
- Painter::for_each_line_segment_on_cubic_bezier_curve(control_0, control_1, cursor, segment.point(), [&](FloatPoint const& p0, FloatPoint const& p1) {
+ auto control_0 = curve.through_0();
+ auto control_1 = curve.through_1();
+ Painter::for_each_line_segment_on_cubic_bezier_curve(control_0, control_1, cursor, segment.point(), [&](FloatPoint p0, FloatPoint p1) {
add_line(p0, p1);
});
cursor = segment.point();
@@ -310,7 +310,7 @@ void Path::segmentize_path()
}
case Segment::Type::EllipticalArcTo: {
auto& arc = static_cast<EllipticalArcSegment&>(segment);
- Painter::for_each_line_segment_on_elliptical_arc(cursor, arc.point(), arc.center(), arc.radii(), arc.x_axis_rotation(), arc.theta_1(), arc.theta_delta(), [&](FloatPoint const& p0, FloatPoint const& p1) {
+ Painter::for_each_line_segment_on_elliptical_arc(cursor, arc.point(), arc.center(), arc.radii(), arc.x_axis_rotation(), arc.theta_1(), arc.theta_delta(), [&](FloatPoint p0, FloatPoint p1) {
add_line(p0, p1);
});
cursor = segment.point();
diff --git a/Userland/Libraries/LibGfx/Path.h b/Userland/Libraries/LibGfx/Path.h
index 5349020d3d..2173749d18 100644
--- a/Userland/Libraries/LibGfx/Path.h
+++ b/Userland/Libraries/LibGfx/Path.h
@@ -28,14 +28,14 @@ public:
EllipticalArcTo,
};
- Segment(FloatPoint const& point)
+ Segment(FloatPoint point)
: m_point(point)
{
}
virtual ~Segment() = default;
- FloatPoint const& point() const { return m_point; }
+ FloatPoint point() const { return m_point; }
virtual Type type() const = 0;
protected:
@@ -44,7 +44,7 @@ protected:
class MoveSegment final : public Segment {
public:
- MoveSegment(FloatPoint const& point)
+ MoveSegment(FloatPoint point)
: Segment(point)
{
}
@@ -55,7 +55,7 @@ private:
class LineSegment final : public Segment {
public:
- LineSegment(FloatPoint const& point)
+ LineSegment(FloatPoint point)
: Segment(point)
{
}
@@ -68,7 +68,7 @@ private:
class QuadraticBezierCurveSegment final : public Segment {
public:
- QuadraticBezierCurveSegment(FloatPoint const& point, FloatPoint const& through)
+ QuadraticBezierCurveSegment(FloatPoint point, FloatPoint through)
: Segment(point)
, m_through(through)
{
@@ -76,7 +76,7 @@ public:
virtual ~QuadraticBezierCurveSegment() override = default;
- FloatPoint const& through() const { return m_through; }
+ FloatPoint through() const { return m_through; }
private:
virtual Type type() const override { return Segment::Type::QuadraticBezierCurveTo; }
@@ -86,7 +86,7 @@ private:
class CubicBezierCurveSegment final : public Segment {
public:
- CubicBezierCurveSegment(FloatPoint const& point, FloatPoint const& through_0, FloatPoint const& through_1)
+ CubicBezierCurveSegment(FloatPoint point, FloatPoint through_0, FloatPoint through_1)
: Segment(point)
, m_through_0(through_0)
, m_through_1(through_1)
@@ -95,8 +95,8 @@ public:
virtual ~CubicBezierCurveSegment() override = default;
- FloatPoint const& through_0() const { return m_through_0; }
- FloatPoint const& through_1() const { return m_through_1; }
+ FloatPoint through_0() const { return m_through_0; }
+ FloatPoint through_1() const { return m_through_1; }
private:
virtual Type type() const override { return Segment::Type::CubicBezierCurveTo; }
@@ -107,7 +107,7 @@ private:
class EllipticalArcSegment final : public Segment {
public:
- EllipticalArcSegment(FloatPoint const& point, FloatPoint const& center, const FloatPoint radii, float x_axis_rotation, float theta_1, float theta_delta, bool large_arc, bool sweep)
+ EllipticalArcSegment(FloatPoint point, FloatPoint center, const FloatPoint radii, float x_axis_rotation, float theta_1, float theta_delta, bool large_arc, bool sweep)
: Segment(point)
, m_center(center)
, m_radii(radii)
@@ -121,8 +121,8 @@ public:
virtual ~EllipticalArcSegment() override = default;
- FloatPoint const& center() const { return m_center; }
- FloatPoint const& radii() const { return m_radii; }
+ FloatPoint center() const { return m_center; }
+ FloatPoint radii() const { return m_radii; }
float x_axis_rotation() const { return m_x_axis_rotation; }
float theta_1() const { return m_theta_1; }
float theta_delta() const { return m_theta_delta; }
@@ -145,12 +145,12 @@ class Path {
public:
Path() = default;
- void move_to(FloatPoint const& point)
+ void move_to(FloatPoint point)
{
append_segment<MoveSegment>(point);
}
- void line_to(FloatPoint const& point)
+ void line_to(FloatPoint point)
{
append_segment<LineSegment>(point);
invalidate_split_lines();
@@ -172,26 +172,26 @@ public:
line_to({ previous_x, y });
}
- void quadratic_bezier_curve_to(FloatPoint const& through, FloatPoint const& point)
+ void quadratic_bezier_curve_to(FloatPoint through, FloatPoint point)
{
append_segment<QuadraticBezierCurveSegment>(point, through);
invalidate_split_lines();
}
- void cubic_bezier_curve_to(FloatPoint const& c1, FloatPoint const& c2, FloatPoint const& p2)
+ void cubic_bezier_curve_to(FloatPoint c1, FloatPoint c2, FloatPoint p2)
{
append_segment<CubicBezierCurveSegment>(p2, c1, c2);
invalidate_split_lines();
}
- void elliptical_arc_to(FloatPoint const& point, FloatPoint const& radii, double x_axis_rotation, bool large_arc, bool sweep);
- void arc_to(FloatPoint const& point, float radius, bool large_arc, bool sweep)
+ void elliptical_arc_to(FloatPoint point, FloatPoint radii, double x_axis_rotation, bool large_arc, bool sweep);
+ void arc_to(FloatPoint point, float radius, bool large_arc, bool sweep)
{
elliptical_arc_to(point, { radius, radius }, 0, large_arc, sweep);
}
// Note: This does not do any sanity checks!
- void elliptical_arc_to(FloatPoint const& endpoint, FloatPoint const& center, FloatPoint const& radii, double x_axis_rotation, double theta, double theta_delta, bool large_arc, bool sweep)
+ void elliptical_arc_to(FloatPoint endpoint, FloatPoint center, FloatPoint radii, double x_axis_rotation, double theta, double theta_delta, bool large_arc, bool sweep)
{
append_segment<EllipticalArcSegment>(
endpoint,
diff --git a/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp b/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp
index e46bbda70d..9048b167a4 100644
--- a/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp
+++ b/Userland/Libraries/LibWeb/Layout/BlockContainer.cpp
@@ -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)
diff --git a/Userland/Libraries/LibWeb/Layout/BlockContainer.h b/Userland/Libraries/LibWeb/Layout/BlockContainer.h
index 4f89a7659b..7ead413d5e 100644
--- a/Userland/Libraries/LibWeb/Layout/BlockContainer.h
+++ b/Userland/Libraries/LibWeb/Layout/BlockContainer.h
@@ -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;
diff --git a/Userland/Libraries/LibWeb/Layout/LineBoxFragment.h b/Userland/Libraries/LibWeb/Layout/LineBoxFragment.h
index cdbc5ad0bb..d78efcfa83 100644
--- a/Userland/Libraries/LibWeb/Layout/LineBoxFragment.h
+++ b/Userland/Libraries/LibWeb/Layout/LineBoxFragment.h
@@ -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; }
diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.cpp b/Userland/Libraries/LibWeb/Painting/Paintable.cpp
index 82307810b3..1fcc14fd27 100644
--- a/Userland/Libraries/LibWeb/Painting/Paintable.cpp
+++ b/Userland/Libraries/LibWeb/Painting/Paintable.cpp
@@ -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 {};
}
diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.h b/Userland/Libraries/LibWeb/Painting/Paintable.h
index c0b335f4cc..a868ff9ab3 100644
--- a/Userland/Libraries/LibWeb/Painting/Paintable.h
+++ b/Userland/Libraries/LibWeb/Painting/Paintable.h
@@ -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; }
diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
index 6bc37f41f6..def34ab773 100644
--- a/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
+++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.cpp
@@ -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);
diff --git a/Userland/Libraries/LibWeb/Painting/PaintableBox.h b/Userland/Libraries/LibWeb/Painting/PaintableBox.h
index fe453aa6b0..b4eec2fb6a 100644
--- a/Userland/Libraries/LibWeb/Painting/PaintableBox.h
+++ b/Userland/Libraries/LibWeb/Painting/PaintableBox.h
@@ -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&);
diff --git a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp b/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp
index d9a1adee93..ab124398d3 100644
--- a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp
+++ b/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp
@@ -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);
diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
index 747008ab46..b4c0444599 100644
--- a/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
+++ b/Userland/Libraries/LibWeb/Painting/StackingContext.cpp
@@ -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 {};
diff --git a/Userland/Libraries/LibWeb/Painting/StackingContext.h b/Userland/Libraries/LibWeb/Painting/StackingContext.h
index 0fc7173c2a..72aba5dce6 100644
--- a/Userland/Libraries/LibWeb/Painting/StackingContext.h
+++ b/Userland/Libraries/LibWeb/Painting/StackingContext.h
@@ -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;