33 _name =
"CanvasItemCurve:Null";
41 , _curve(
std::make_unique<
Geom::LineSegment>(p0, p1))
43 _name =
"CanvasItemCurve:Line";
53 , _curve(
std::make_unique<
Geom::CubicBezier>(p0, p1, p2, p3))
55 _name =
"CanvasItemCurve:CubicBezier";
64 _name =
"CanvasItemCurve:Line";
65 _curve = std::make_unique<Geom::LineSegment>(p0, p1);
76 _name =
"CanvasItemCurve:CubicBezier";
77 _curve = std::make_unique<Geom::CubicBezier>(p0, p1, p2, p3);
164 buf.cr->begin_new_path();
166 if (
curve.size() == 2) {
178 buf.cr->stroke_preserve();
void ink_cairo_set_source_color(Cairo::RefPtr< Cairo::Context > &ctx, Colors::Color const &color, bool to_srgb)
Set the source color of the Cairo context.
Cairo integration helpers.
Two-dimensional Bezier curve of arbitrary order.
Two-dimensional point that doubles as a vector.
std::unique_ptr< Geom::BezierCurve > _curve
double closest_distance_to(Geom::Point const &p) const
Returns distance between point in canvas units and nearest point on curve.
void set_width(int width)
Set stroke width.
void _update(bool propagate) override
Update and redraw control curve.
void set_coords(Geom::Point const &p0, Geom::Point const &p1)
Set a linear control curve.
void _render(Inkscape::CanvasItemBuffer &buf) const override
Render curve to screen via Cairo.
bool contains(Geom::Point const &p, double tolerance=0) override
Returns true if point p (in canvas units) is within tolerance (canvas units) distance of curve.
CanvasItemCurve(CanvasItemGroup *group)
Create an null control curve.
void set_bg_alpha(float alpha)
Set background stroke alpha.
Geom::Affine const & affine() const
constexpr Coord infinity()
Get a value representing infinity.
Specific geometry functions for Inkscape, not provided my lib2geom.
auto expandedBy(Geom::IntRect rect, int amount)
Various utility functions.
Angle distance(Angle const &a, Angle const &b)
Helper class to stream background task notifications as a series of messages.
Class used when rendering canvas items.