Skip to main content

scroll

Function scroll 

Source
pub fn scroll(dx: f32, dy_native_down_positive: f32, x: f32, y: f32) -> UiEvent
Expand description

Build a UiEvent::Scroll, owning the native-to-quadraui sign flip once instead of every backend re-deriving (and re-commenting) it.

dy_native_down_positive is the backend’s raw vertical delta using the convention where positive means scroll-down / content-forward — GTK EventControllerScroll’s dy, Cocoa NSEvent.scrollingDeltaY, and crossterm’s ScrollUp/ScrollDown (translated to the equivalent -1.0 / +1.0 notch) all use this convention natively. UiEvent::Scroll::delta’s convention is the opposite — positive y = up, toward the top of content — so this negates once, here, rather than in each caller.

dx is passed straight through unnegated: every native backend quadraui supports already agrees with quadraui’s positive-x-is-right convention, so there is no flip to own.

Win-GUI is the one native backend that does not follow the positive-down convention on its raw delta (win::events::win_wheel_to_uievent’s doc explains why) — its translator does not call this constructor.