1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Multi-touch gesture routing on [`App`] — the capture machinery that turns
//! the per-frame gesture aggregate into a routed, captured
//! [`Event::MultiTouch`]. Split out of `app.rs` (800-line guardrail).
//!
//! The aggregate itself is recomputed and published to the thread-local by
//! `App::paint` (display-only consumers still read
//! [`crate::current_multi_touch`]); this module is the *event* half. It runs
//! at the top of `paint`, before the paint traversal, so a widget that
//! consumes the event this frame marks its cached window subtree dirty
//! through the ordinary `Consumed → request_draw → epoch-bump → mark_dirty`
//! chain (see [`crate::widget::tree::dispatch_event`]) and re-rasters in the
//! same frame — no gesture-specific dirty hack needed.
//!
//! # Capture semantics
//!
//! On the frame the aggregate transitions `None → Some`, the centroid is
//! hit-tested down the tree exactly like a `MouseDown`. The deepest widget
//! that consumes the event captures the gesture: every later frame delivers
//! along that captured path, even if the centroid drifts outside the widget.
//! If the start hit-test finds no consumer, the gesture routes nowhere for
//! its whole lifetime. The capture clears when the aggregate returns to
//! `None`.
use crateEvent;
use cratedispatch_event;
use crateApp;