Commit 760a6502 authored by Hixie's avatar Hixie

fix the hang when clicking the drawer in the stocks app

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/980043005
parent 169dea32
...@@ -73,10 +73,12 @@ class DrawerAnimation { ...@@ -73,10 +73,12 @@ class DrawerAnimation {
void _animateToPosition(double targetPosition) { void _animateToPosition(double targetPosition) {
double distance = (targetPosition - _position).abs(); double distance = (targetPosition - _position).abs();
if (distance != 0) {
double targetDuration = distance / _kWidth * _kBaseSettleDurationMS; double targetDuration = distance / _kWidth * _kBaseSettleDurationMS;
double duration = math.min(targetDuration, _kMaxSettleDurationMS); double duration = math.min(targetDuration, _kMaxSettleDurationMS);
_animate(duration, _position, targetPosition, _kAnimationCurve); _animate(duration, _position, targetPosition, _kAnimationCurve);
} }
}
void handleFlingStart(event) { void handleFlingStart(event) {
double direction = event.velocityX.sign; double direction = event.velocityX.sign;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment