| 17 | .toCanon().autoConstructs(() -> new IdempotencyMap<OnDrop>(OnDrop.class)); |
| 18 | |
| 19 | public void dispatch(Box root, Window.Event<Window.Drop> drop) { |
| 20 | |
| 21 | Box startAt = Intersects.startAt(drop.after.mouseState, root); |
| 22 | |
| 23 | startAt.find(onDrop, startAt.upwards()).flatMap(x -> x.values() |
| 24 | .stream()) |
| 25 | .forEach(x -> x.onDrop(drop)); |
| 26 | |
| 27 | if (!drop.properties.isTrue(Window.consumed, false)) |
| 28 | startAt.find(onDrop, startAt.downwards()) |
| 29 | .flatMap(x -> x.values().stream()) |
| 30 | .forEach(x -> x.onDrop(drop)); |
| 31 | } |
| 32 | |
| 33 | private boolean intersectsWith(Box x, Vec2 position) { |
| 34 | Rect f = x.properties.get(Box.frame); |