30 if (fill_enabled_ == v)
return;
38 if (stroke_enabled_ == v)
return;
45 if (fill_color_ == c)
return;
52 if (stroke_color_ == c)
return;
59 if (stroke_width_ == w)
return;
66 if (fill_rule_ == r)
return;
94 void quad_to(
float cpx,
float cpy,
float x,
float y) {
95 path_.quad_to(cpx, cpy, x, y);
100 void cubic_to(
float cp1x,
float cp1y,
float cp2x,
float cp2y,
float x,
float y) {
101 path_.cubic_to(cp1x, cp1y, cp2x, cp2y, x, y);
102 bounds_dirty_ =
true;
118 path_ = std::move(p);
119 bounds_dirty_ =
true;
131 float stroke_width_ = 1.0f;
133 bool fill_enabled_ =
true;
134 bool stroke_enabled_ =
false;
136 mutable bool bounds_dirty_ =
true;
Definition canvas.hpp:240
void mark_dirty()
Mark this node and (recursively) every ancestor dirty.
SceneNode(SceneNodeKind kind)
Definition scene_node.hpp:108
float stroke_width() const
Definition scene_path.hpp:57
bool fill_enabled() const
Whether this path should be filled (default true).
Definition scene_path.hpp:28
void set_stroke_color(Color c)
Definition scene_path.hpp:51
Color stroke_color() const
Definition scene_path.hpp:50
void set_fill_color(Color c)
Definition scene_path.hpp:44
void cubic_to(float cp1x, float cp1y, float cp2x, float cp2y, float x, float y)
Definition scene_path.hpp:100
void set_path(Path p)
Replace the geometry wholesale — the drop-in for callers that built a Path elsewhere (an SVG parse,...
Definition scene_path.hpp:117
void clear()
Definition scene_path.hpp:75
void paint_geometry(Canvas &canvas) const override
Paint this node (and its sub-tree) into canvas.
Color fill_color() const
Definition scene_path.hpp:43
void line_to(float x, float y)
Definition scene_path.hpp:88
ScenePath()
Definition scene_path.hpp:25
void set_fill_rule(FillRule r)
Definition scene_path.hpp:65
const Path & path() const
The node's geometry, as a value. Copying it out is O(1) (see Path).
Definition scene_path.hpp:113
void set_fill_enabled(bool v)
Definition scene_path.hpp:29
FillRule fill_rule() const
Definition scene_path.hpp:64
bool stroke_enabled() const
Whether this path should be stroked (default false).
Definition scene_path.hpp:36
void move_to(float x, float y)
Definition scene_path.hpp:82
void close_path()
Definition scene_path.hpp:106
SceneRect local_bounds() const override
Local-coordinate bounding box (pre-transform, pre-opacity).
void quad_to(float cpx, float cpy, float x, float y)
Definition scene_path.hpp:94
void set_stroke_enabled(bool v)
Definition scene_path.hpp:37
void set_stroke_width(float w)
Definition scene_path.hpp:58
Definition affine_transform.hpp:24
FillRule
Winding rule used to decide what counts as "inside" a path.
Definition path.hpp:54
@ nonzero
Definition path.hpp:54
SceneNodeKind
Kind discriminator — keeps dynamic_cast off the hot path.
Definition scene_node.hpp:91
static constexpr Color rgba(float r, float g, float b, float a=1.0f)
Construct from float channels [0,1] (>1.0 allowed for HDR).
Definition canvas.hpp:56
Axis-aligned bounding box used for repaint-rect math.
Definition scene_node.hpp:27