18#include <cairomm/matrix.h>
33 _name =
"CanvasItemBpath:Null";
42 , _path(
std::move(path))
43 , _phantom_line(phantom_line)
45 _name =
"CanvasItemBpath";
63 defer([=,
this, path = std::move(path)] ()
mutable {
64 _path = std::move(path);
85 defer([
this, dashes = std::move(dashes)] ()
mutable {
110 if (tolerance == 0) {
115 if ((
_fill & 0xff) != 0) {
153 bool do_fill = (
_fill & 0xff) != 0;
154 bool do_stroke = (
_stroke & 0xff) != 0;
156 if (!do_fill && !do_stroke) {
164 buf.cr->set_tolerance(0.5);
165 buf.cr->begin_new_path();
174 Cairo::Context::FillRule::EVEN_ODD : Cairo::Context::FillRule::WINDING);
175 buf.cr->fill_preserve();
181 buf.cr->translate(-
buf.rect.min().x(), -
buf.rect.min().y());
183 buf.cr->fill_preserve();
191 buf.cr->stroke_preserve();
202 buf.cr->set_source_rgba(1.0, 1.0, 1.0, 0.25);
203 buf.cr->set_line_width(2.0);
204 buf.cr->stroke_preserve();
212 buf.cr->begin_new_path();
void feed_pathvector_to_cairo(cairo_t *ct, Geom::PathVector const &pathv, Geom::Affine trans, Geom::OptRect area, bool optimize_stroke, double stroke_width)
Feeds path-creating calls to the cairo context translating them from the PathVector,...
void ink_cairo_set_source_rgba32(cairo_t *ct, guint32 rgba)
Cairo integration helpers.
Coord descrim() const
Calculate the descriminant.
Affine inverse() const
Compute the inverse matrix.
int winding(Point const &p) const
Determine the winding number at the specified point.
bool empty() const
Check whether the vector contains any paths.
std::optional< PathVectorTime > nearestTime(Point const &p, Coord *dist=NULL) const
Two-dimensional point that doubles as a vector.
CanvasItemBpath(CanvasItemGroup *group)
Create a null control bpath.
std::vector< double > _dashes
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 bpath.
double closest_distance_to(Geom::Point const &p) const
Returns distance between point in canvas units and nearest point on bpath.
void set_bpath(SPCurve const *curve, bool phantom_line=false)
Set a control bpath.
void set_dashes(std::vector< double > &&dashes)
void set_fill(uint32_t rgba, SPWindRule fill_rule)
Set the fill color and fill rule.
void _update(bool propagate) override
Update and redraw control bpath.
void _render(Inkscape::CanvasItemBuffer &buf) const override
Render bpath to screen via Cairo.
double get_effective_outline() const
Get the effective outline.
Cairo::RefPtr< Cairo::Pattern > _fill_pattern
Geom::Affine const & affine() const
Wrapper around a Geom::PathVector object.
constexpr uint32_t SP_RGBA32_A_U(uint32_t v)
constexpr Coord infinity()
Get a value representing infinity.
Geom::OptRect bounds_exact_transformed(Geom::PathVector const &pv, Geom::Affine const &t)
Specific geometry functions for Inkscape, not provided my lib2geom.
auto expandedBy(Geom::IntRect rect, int amount)
Helper class to stream background task notifications as a series of messages.
Class used when rendering canvas items.