nativeview-scroll-physics
Standalone, zero-allocation scroll physics module for native-view-engine implementing
nativeview_layout::ScrollPhysicsEngine over the closed-form solvers in nativeview-physics.
Capabilities
- Whole-engine pluggability: swap between
PlatformScrollPhysics, customPooledScrollPhysics<B>, or any independentScrollPhysicsEngineviaLaidOutScene::set_scroll_physics/SkiaBackend::set_scroll_physics. - Composable
ScrollBehaviordecorators: stackBoundaryPhysics(ClampBoundary,RubberBandBoundary),FlingPhysics(ExponentialDecayFling,NoFling),SnapPhysics(FreeScroll,PageSnap,FixedExtentSnap,DetentSnap),SpringReturn, andWheelPhysics(SmoothWheel,InstantWheel) viaComposedScrollBehavior. - Platform presets:
ScrollPhysicsProfile::{Apple, Android, Windows, Linux}andPlatformScrollPhysics::platform_default(), preserving macOS native-momentum rules. - Per-container sparse overrides (
nv.scroll_physics): attachScrollPhysicsto anyscrollviewfor zero-overhead per-container bounce, snap, deceleration, spring, or smooth-wheel overrides (auto-honoringScroll::paging).
Quick Example
use ;
use ;
use ;
let mut scene = new;
scene.set_scroll_physics;
let carousel_behavior = new
.with_boundary
.with_fling
.with_snap
.with_wheel;
scene.set_scroll_physics;