Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't get stuck in overscroll #264

Merged
merged 2 commits into from Apr 25, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Never trigger overscroll bounce when overscroll is disabled

This fixes a bug where rounding could cause a layer to enter overscroll even
if CAN_OVERFLOW is false, and then get stuck in overscroll.
  • Loading branch information
mbrubeck committed Apr 19, 2016
commit 5dcd4d3e0b0830ae69975e7c875cbbef774d0013
@@ -634,7 +634,8 @@ impl Frame {
}

let overscroll_amount = layer.overscroll_amount();
let overscrolling = overscroll_amount.width != 0.0 || overscroll_amount.height != 0.0;
let overscrolling = CAN_OVERSCROLL && (overscroll_amount.width != 0.0 ||
overscroll_amount.height != 0.0);
if overscrolling {
if overscroll_amount.width != 0.0 {
delta.x /= overscroll_amount.width.abs()
@@ -676,7 +677,9 @@ impl Frame {
layer.scrolling.offset.x = layer.scrolling.offset.x.round();
layer.scrolling.offset.y = layer.scrolling.offset.y.round();

layer.stretch_overscroll_spring();
if CAN_OVERSCROLL {
layer.stretch_overscroll_spring();
}
}

pub fn tick_scrolling_bounce_animations(&mut self) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.