Scoop API

scoop:scoop.surface:0.1.0

src/shared/input/hit.scoop

Selected production source · src/shared/input/hit.scoop

1package scoop.surface
3import scoop.graphics.Point
5/** An owned route entry with coordinates from the same accepted scene. */
6public struct InputHit(val scope: InputScope, val localPosition: Point?)
8internal fun InputRouter.hitInput(point: Point): Array<InputHit> {
9 checkThread()
10 if (closed || !point.x.isFinite() || !point.y.isFinite())
11 return []
12 val route = deliveries(hit(point), Some(point))
13 return Array<InputHit>(route.size) {
14 index ->
15 val value = route[index]
16 InputHit(value.scope, value.position)
17 }