std :: gui::gui_path
Struct std::GuiPath
struct GuiPath {
struct Vec<struct GuiPathSeg> segs;
float curX;
float curY;
float startX;
float startY;
int hasCurrent;
}Fields
current point
start of the current subpath
Methods
Closes the current subpath (a straight line back to its start).
Circular arc around (cx,cy) from angle a0 to a1, clockwise on screen unless 'ccw'; joined to the current point with a line (HTML canvas' arc()). Approximated with cubics (error < 0.01% of the radius).
A rounded corner from the current point toward (x1,y1), then toward (x2,y2), with radius r (HTML canvas' arcTo()).
void ellipse_arc(
float cx,
float cy,
float rx,
float ry,
float rotation,
float a0,
float a1,
int ccw,
)source · definitionAn elliptic arc (rotated by 'rotation') — HTML canvas' ellipse().
void svg_arc_to(
float rx,
float ry,
float xAxisRotation,
int largeArc,
int sweep,
float x,
float y,
)source · definitionSVG's elliptical arc command from the current point to (x,y).
Closed shapes, each its own subpath, clockwise on screen.
void rounded_rect4(
float x,
float y,
float w,
float h,
float tl,
float tr,
float br,
float bl,
)source · definitionPer-corner radii: top-left, top-right, bottom-right, bottom-left.
A closed polygon through n points (xy pairs: pts[0..2n)).
Parses SVG path data ("M10 10 h 20 q 5 5 0 10 z ..." — every command of SVG 1.1, absolute and relative) and appends it. Returns 1, or 0 at the first malformed command (what came before it stays).
Appends 'other' transformed by 'm'.
Transforms every point of this path in place.
Bounding box of the points (control points included: may be a bit larger than the curve).
number of segments
= drop()