pub struct PanClaim {
pub axes: PanAxes,
pub devices: PointerKindMask,
pub kinetic: bool,
}Expand description
A node’s declaration that it is a pan surface: it wants to consume a direct pointer’s drag as content panning rather than let it arm a drag/ swipe recognizer or fall through.
Declared independently of TouchAction — a scrollable states “I pan”
via PanClaim regardless of what its own touch_action permits;
TouchAction is what the arbitration consults to decide whether a claim
further down the chain is still reachable. See
WidgetTree::pan_candidates.
Declaring a pan claim is orthogonal to having an on_scroll handler: a
SpinBox increments on wheel, a TabBar remaps wheel to horizontal tab
scroll, and SceneView zooms on Ctrl-wheel — none of those is a pan, and
none of them declares a PanClaim. A scroll container declares itself
explicitly via scroll_container.
Fields§
§axes: PanAxesWhich axes this surface wants to pan on.
devices: PointerKindMaskWhich pointer kinds this claim applies to. Defaults to
PointerKindMask::DIRECT (touch + pen, never mouse) — see the
module docs on why a mouse must never be treated as a panning
pointer.
kinetic: boolWhether a release should hand off to a fling/settle simulation. false
by default; scroll_container’s
sugar turns it on.
Implementations§
Trait Implementations§
impl Copy for PanClaim
Source§impl Default for PanClaim
impl Default for PanClaim
Source§fn default() -> Self
fn default() -> Self
No axes claimed, PointerKindMask::DIRECT devices, not kinetic.
vertical / horizontal /
both build on this rather than repeating the device
mask.