Draws on a canvas, constrained to a specific region
Creates, using coordinate in canvas coordinates
Returns a copy of p offset by the region's x & y
p
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
Line with
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
regionCompute
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.
toAbsRegion({x:0,y:0})
Converts a point to a region-relative one.
Draws on a canvas, constrained to a specific region