Skip to main content

apply_scroll_bindings

Function apply_scroll_bindings 

Source
pub fn apply_scroll_bindings(
    store: Res<'_, PropertyStore>,
    q: Query<'_, '_, (&BindScroll, &mut ScrollOffset, Option<&mut Scroll>)>,
    new_binds: Query<'_, '_, (), Added<BindScroll>>,
)
Expand description

Parses PropertyStore[Global(name)] as f32 and writes it into the vertical ScrollOffset of every BindScroll + Scroll entity (W6 T6).

Reactive scroll control with NO per-frame script hook: the script writes the signal once; this dirty-gated reader (same fast-path + Added escape hatch as apply_value_bindings) applies it on the write tick. The raw value is written unclamped - clamp_scroll_offsets (TickStage::A11ySync, registered by lumen-primitives) clips it to the content extent the same way it clips user scrolling, so signal-driven and wheel-driven offsets share one clamp rule.

Applying a signal value also zeroes any in-flight fling velocity on the container: a reactive scroll_to must land exactly where the script said, not get dragged onward by leftover momentum.