ToolTouchEvent

Interface representing the touch event handling for a drawing tool. It defines methods for handling touch events such as initialization, start, move, end, and drawing on the canvas.

Functions

Link copied to clipboard
abstract fun onDrawIntoCanvas(drawScope: DrawScope, canvas: Canvas, paint: Paint = Paint(), isMultiTouch: Boolean = false)

Draws the tape paths and image paths onto the canvas during the touch interaction. This method is called continuously during the touch event to render the tape and image paths.

Link copied to clipboard
abstract fun onTouchEnd(paint: Paint = Paint())

Handles the end of a touch event. If the touch was a tap, it selects the tape item at the current position. Otherwise, it creates a new tape item and adds it to the controller.

Link copied to clipboard
abstract fun onTouchInitialize()

Initializes the touch event, resetting all paths and touch points.

Link copied to clipboard
abstract fun onTouchMove(previousOffset: Offset = Offset.Zero, currentOffset: Offset = Offset.Zero, paint: Paint = Paint())

Handles movement during a touch event. Updates the tape path and image path as the user moves their finger.

Link copied to clipboard
abstract fun onTouchStart(offset: Offset = Offset.Zero, paint: Paint = Paint())

Handles the start of a touch event. Initializes the paths and stores the first touch point.