Defines the RevCanvas class, which encapsulates a grid's HTML canvas element and manages its rendering and user interaction. It is the central component for rendering and handling all user interactions with the grid's canvas surface.
Creates a CanvasRenderingContext2D for the canvas and then wraps it in a RevCachedCanvasRenderingContext2D object. The RevCachedCanvasRenderingContext2D
object caches the context's properties and will not update them unless they are changed. All drawing related operations on the canvas use RevCachedCanvasRenderingContext2D
.
Ensures that the canvas element is always resized to match the size of its parent element (hostElement). Resize related events are debounced to minimise the number of renders when resizing.
Drag events are simulated by:
dragstart
events from canvas elementdrag
events when canvas mousemove
events occur while dragging is activedragEnd
events when canvas mouseup
of mousecancel
events occur while dragging is active