GGUI::GGCanvas class

What a canvas's drawing function draws with.

Public functions

auto Width() const -> float
The canvas's width as last laid out; 0 the first time.
auto Height() const -> float
The canvas's height as last laid out; 0 the first time.
void Line(GGPoint from, GGPoint to, const GGStroke& stroke)
A line with round ends.
void Polyline(std::span<const GGPoint> points, const GGStroke& stroke, bool bClosed = false)
Lines through points, joined; with bClosed, back to the first.
void Arc(GGPoint centre, float radius, float from, float to, const GGStroke& stroke)
Part of a circle from angle from to to, in radians, clockwise from the right.
void Circle(GGPoint centre, float radius, GGColor fill)
A filled circle.
void Triangle(GGPoint a, GGPoint b, GGPoint c, GGColor fill)
A filled triangle.
void Triangles(std::span<const GGPoint> corners, GGColor fill)
Filled triangles: three corners each.
void Rect(GGPoint from, GGPoint to, GGColor fill)
A filled rectangle.
void Bezier(GGPoint a, GGPoint b, GGPoint c, GGPoint d, const GGStroke& stroke)
A cubic curve from a to d, pulled towards b and c.