Get center of region
Gets the drawing context
Gets the width/height, whichever is smaller
Gets the height
Gets the region
Gets the width
Gets the x offset
Gets they y offset
Creates, using coordinate in canvas coordinates
Converts absolute to region point
Clears the region
For debugging, draws an outline of the bounds
Draws connected points in absolute coordinates, however with 0,0 being the top-left of the region.
Thus, this will apply the region offset before drawing.
Points to draw
Stroke style
Line width
Draws a line from a series of points. Assumes region-relative, % coordinates (ie 0..1 scale)
Points to connect, in region-relative coordinates
Stroke style
Line with
Fills the region
Fills text at a region-relative position
Region relative, meaning 0,0 is top-left of region
Fills text at a relative position
Relative, meaning 0.5,0.5 is the middle of the region
Calls the original regionCompute
function passed in to the constructor
to recompute the absolute region
Converts a region-relative point (0..1) to an absolute point, which uses region-relative coordinates.
Eg if the region had an x,y of 100,100, toAbsRegion({x:0,y:0})
will return 0,0.
Draws on a canvas, constrained to a specific region