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,9 +73,11 @@ class DrawerAnimation { ...@@ -73,9 +73,11 @@ class DrawerAnimation {
void _animateToPosition(double targetPosition) { void _animateToPosition(double targetPosition) {
double distance = (targetPosition - _position).abs(); double distance = (targetPosition - _position).abs();
double targetDuration = distance / _kWidth * _kBaseSettleDurationMS; if (distance != 0) {
double duration = math.min(targetDuration, _kMaxSettleDurationMS); double targetDuration = distance / _kWidth * _kBaseSettleDurationMS;
_animate(duration, _position, targetPosition, _kAnimationCurve); double duration = math.min(targetDuration, _kMaxSettleDurationMS);
_animate(duration, _position, targetPosition, _kAnimationCurve);
}
} }
void handleFlingStart(event) { void handleFlingStart(event) {
......
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