dragAndDrop

Function

Common
fun MouseInjectionScope.dragAndDrop(
    start: Offset,
    end: Offset,
    button: MouseButton = MouseButton.Primary,
    durationMillis: Long = DefaultMouseGestureDurationMillis,
)

Use button to drag and drop something from start to end in durationMillis milliseconds. The mouse position is updated to the start position before starting the gesture. The positions defined by the start and end are in the node's local coordinate system, where (0, 0) is the top left corner of the node.

Parameters

startThe position where to press the primary mouse button and initiate the drag, in the node's local coordinate system.
endThe position where to release the primary mouse button and end the drag, in the node's local coordinate system.
buttonThe button to drag with. Uses the primary by default.
durationMillisThe duration of the gesture. By default 300 milliseconds.