Index: sky/examples/fn/widgets/drawer.dart |
diff --git a/sky/examples/fn/widgets/drawer.dart b/sky/examples/fn/widgets/drawer.dart |
index 282310c53e81ffad3805ed32781d24dbdaf1575d..f4a3aa00bbf69650ef274674117bf1000af72da7 100644 |
--- a/sky/examples/fn/widgets/drawer.dart |
+++ b/sky/examples/fn/widgets/drawer.dart |
@@ -73,9 +73,11 @@ class DrawerAnimation { |
void _animateToPosition(double targetPosition) { |
double distance = (targetPosition - _position).abs(); |
- double targetDuration = distance / _kWidth * _kBaseSettleDurationMS; |
- double duration = math.min(targetDuration, _kMaxSettleDurationMS); |
- _animate(duration, _position, targetPosition, _kAnimationCurve); |
+ if (distance != 0) { |
+ double targetDuration = distance / _kWidth * _kBaseSettleDurationMS; |
+ double duration = math.min(targetDuration, _kMaxSettleDurationMS); |
+ _animate(duration, _position, targetPosition, _kAnimationCurve); |
+ } |
} |
void handleFlingStart(event) { |