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

Unified Diff: sky/sdk/lib/widgets/switch.dart

Issue 1226143010: Port Toggleable to the new animation system (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: typo Created 5 years, 5 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 | « sky/sdk/lib/widgets/checkbox.dart ('k') | sky/sdk/lib/widgets/toggleable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/switch.dart
diff --git a/sky/sdk/lib/widgets/switch.dart b/sky/sdk/lib/widgets/switch.dart
index 23e4ce514264138630c9987f719ad7fb0933a47e..80364aaad8d9ae389f61ca86159394ea4bff0235 100644
--- a/sky/sdk/lib/widgets/switch.dart
+++ b/sky/sdk/lib/widgets/switch.dart
@@ -61,9 +61,9 @@ class Switch extends Toggleable {
paint.setDrawLooper(builder.build());
// The thumb contracts slightly during the animation
- double inset = 2.0 - (toggleAnimation.value - 0.5).abs() * 2.0;
+ double inset = 2.0 - (position.value - 0.5).abs() * 2.0;
Point thumbPos = new Point(
- _kTrackRadius + toggleAnimation.value * (_kTrackWidth - _kTrackRadius * 2),
+ _kTrackRadius + position.value * (_kTrackWidth - _kTrackRadius * 2),
_kSwitchHeight / 2.0
);
canvas.drawCircle(thumbPos, _kThumbRadius - inset, paint);
« no previous file with comments | « sky/sdk/lib/widgets/checkbox.dart ('k') | sky/sdk/lib/widgets/toggleable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698