ToolController

Interface representing a tool controller for managing touch events and invalidation ticks. This interface is designed for tools that interact with a canvas, such as drawing tools, erasers, or pointers. It includes methods for managing touch interactions and updating the invalidate state of the canvas.

Inheritors

Properties

Link copied to clipboard
abstract val invalidateTick: Int

The number of invalidate ticks for the tool. This value is used to trigger a redraw of the canvas when the tool's state has changed. It can be incremented each time the tool updates to notify the canvas that it needs to be redrawn.

Link copied to clipboard
abstract val isMultiTouched: Boolean

A boolean indicating whether the tool is currently being multi-touched. This property tracks whether multiple touch points are currently interacting with the tool at once.

Link copied to clipboard

The touch event associated with the tool. This event handles all touch-related interactions, such as starting, moving, and ending touch events.

Functions

Link copied to clipboard
abstract fun updateInvalidateTick()

Updates the invalidate tick count for the tool. This function is used to increment the invalidate tick and signal that the canvas should be updated.