Skip to content

Instantly share code, notes, and snippets.

@andreymusth
Created July 18, 2021 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreymusth/5bbe3392b7181d90964598d62a7e8e16 to your computer and use it in GitHub Desktop.
Save andreymusth/5bbe3392b7181d90964598d62a7e8e16 to your computer and use it in GitHub Desktop.
process 3
private val hitResult: MutableList<PointerInputFilter> = mutableListOf()
fun process(
pointerEvent: PointerInputEvent,
...
): ProcessResult {
// Gets a new PointerInputChangeEvent with the PointerInputEvent.
val internalPointerEvent =
pointerInputChangeEventProducer.produce(pointerEvent, positionCalculator)
// Add new hit paths to the tracker due to down events.
internalPointerEvent.changes.values.forEach { pointerInputChange ->
if (pointerInputChange.changedToDownIgnoreConsumed()) {
root.hitTest(
pointerInputChange.position,
hitResult
)
...
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment