Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Unified Diff: sky/examples/fn/widgets/drawer.dart

Issue 980043005: fix the hang when clicking the drawer in the stocks app (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/framework/animation/generator.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | sky/framework/animation/generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698