Constructs a new drawer from a raw rendering context. This is likely not what you want, if you're just making a sequence.
The rationale for there being two different regions is that it's convenient for some algorithms to have a well-defined area for them to draw their graphic in. Passing the clipping region itself to such algorithms would cause unexpected results when the clipping region itself has to be clipped within a parent drawer.
gfx/Border.EllipseBorder.draw for an example of something that would behave unexpectedly.
StaticcompleteStaticcompleteMakes a ArrowheadStyle non-partial by setting missing properties to defaults.
StaticcompleteStaticcompleteCreates a sub-drawer that draws to the same context as this one, but clipped to a lesser or equal region.
Area where the resulting sub-drawer will draw, in the coordinates of the current drawer's region. The sub-drawer's clipping region will be constrained to the clipping region of this instance.
constructor for why there is a separate drawing and clipping region.
Gets the size of the drawing region.
Gets the size of the clipping region.
Draws the head of an arrow at the end of the specified line.
A full arrow can be drawn by calling drawLine with the same points.
A two-headed arrow can be drawn by calling this again, but with the start and end points swapped.
Draws an ellipse.
Draws some text. You can use gfx/TextWrapper.TextWrapper if you need wrapping.
getImageData, but only within the clipping region of this drawer.
Optionalsettings: ImageDataSettingsEscape hatch that gives you direct access to the underlying CanvasRenderingContext2D.
SAFETY: The drawing state stack MUST NOT be different after your function returns! This is to prevent future drawing operations from being affected.
Gets the underlying canvas rendering context. Prefer not using this, since it defeats the whole purpose of being able to draw with styles and clipping. Here be dragons!
Draws onto a Region of a CanvasRenderingContext2D.