Table Of Contents
Damped scroll effect¶
New in version 3.0.0.
This scroll effect is inspired by Flutter’s BouncingScrollPhysics, which mimics iOS-style scrolling behavior. Key features:
Logarithmic resistance during overscroll drag (rubber band feel)
Critically damped spring for bounce-back (no oscillation)
Exponential friction for momentum scrolling
Mathematically guaranteed stability
IMPLEMENTATION NOTES:¶
This is a clean-room implementation based on understanding the physics and algorithms used in Flutter and iOS, not a direct port of their code.
Key concepts used: - Critical damping: Standard physics (ξ = 1.0, c = 2√(km)) - Rubber band formula: Mathematical transformation inspired by WebKit/iOS - Spring physics: Hooke’s Law (F = -kx) + damping (F = -cv)
ATTRIBUTION:¶
Inspired by: - Flutter’s BouncingScrollPhysics (BSD 3-Clause License)
iOS UIScrollView rubber-banding behavior
WebKit ScrollController implementation (BSD/LGPL)
The mathematical formulas and physics concepts used are not copyrightable. No source code was copied from Flutter, iOS, or WebKit.
Mathematical formulas, physical laws, and algorithms are not subject to copyright. This implementation uses standard physics equations and mathematical transformations that are in the public domain.
Differences from the original DampedScrollEffect:¶
This implementation is different from the original DampedScrollEffect that was introduced in Kivy 1.7.0. The original DampedScrollEffect had a numerical instability issue. This implementation uses critical damping to ensure the effect is stable. Additionally the properties in the effect are different, and allow for more control over the effect.
- class kivy.effects.dampedscroll.DampedScrollEffect(**kwargs)¶
Bases:
kivy.effects.scroll.ScrollEffectFlutter-inspired scroll effect with iOS-style rubber banding.
This implementation uses: - Logarithmic resistance for overscroll (increasing resistance as you pull) - Critically damped spring for bounce-back (no oscillation) - Exponential friction for smooth momentum
See module documentation for more information.
- update_velocity(dt)¶
(internal) Update the velocity according to the frametime and friction.