mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:28:12 +00:00
LibGfx: Make Gfx::Path const-correct internally (segment list)
This commit is contained in:
parent
485958bb6f
commit
ca44b26b2a
2 changed files with 4 additions and 4 deletions
|
@ -291,7 +291,7 @@ void Path::segmentize_path()
|
|||
break;
|
||||
}
|
||||
case Segment::Type::QuadraticBezierCurveTo: {
|
||||
auto control = static_cast<QuadraticBezierCurveSegment&>(segment).through();
|
||||
auto control = static_cast<QuadraticBezierCurveSegment const&>(segment).through();
|
||||
Painter::for_each_line_segment_on_bezier_curve(control, cursor, segment.point(), [&](FloatPoint p0, FloatPoint p1) {
|
||||
add_line(p0, p1);
|
||||
});
|
||||
|
@ -309,7 +309,7 @@ void Path::segmentize_path()
|
|||
break;
|
||||
}
|
||||
case Segment::Type::EllipticalArcTo: {
|
||||
auto& arc = static_cast<EllipticalArcSegment&>(segment);
|
||||
auto& arc = static_cast<EllipticalArcSegment const&>(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 p0, FloatPoint p1) {
|
||||
add_line(p0, p1);
|
||||
});
|
||||
|
|
|
@ -218,7 +218,7 @@ public:
|
|||
float x;
|
||||
};
|
||||
|
||||
NonnullRefPtrVector<Segment> const& segments() const { return m_segments; }
|
||||
NonnullRefPtrVector<Segment const> const& segments() const { return m_segments; }
|
||||
auto& split_lines() const
|
||||
{
|
||||
if (!m_split_lines.has_value()) {
|
||||
|
@ -268,7 +268,7 @@ private:
|
|||
m_segments.append(adopt_ref(*new T(forward<Args>(args)...)));
|
||||
}
|
||||
|
||||
NonnullRefPtrVector<Segment> m_segments {};
|
||||
NonnullRefPtrVector<Segment const> m_segments {};
|
||||
|
||||
Optional<Vector<SplitLineSegment>> m_split_lines {};
|
||||
Optional<Gfx::FloatRect> m_bounding_box;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue