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

Unified Diff: sky/sdk/lib/framework/widgets/wrappers.dart

Issue 1182743002: Animate checkboxes (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: transition to purple more gradually Created 5 years, 6 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
Index: sky/sdk/lib/framework/widgets/wrappers.dart
diff --git a/sky/sdk/lib/framework/widgets/wrappers.dart b/sky/sdk/lib/framework/widgets/wrappers.dart
index 75eeb03fe06d4be7632f2292bc622bd718ea7c72..1d51903f6d504dd57d3e673887fd5cb63c449e5a 100644
--- a/sky/sdk/lib/framework/widgets/wrappers.dart
+++ b/sky/sdk/lib/framework/widgets/wrappers.dart
@@ -49,19 +49,21 @@ class DecoratedBox extends OneChildRenderObjectWrapper {
}
-// TODO(jackson) need a mechanism for marking the RenderCustomPaint as needing paint
class CustomPaint extends OneChildRenderObjectWrapper {
- CustomPaint({ this.callback, UINode child, Object key })
+ CustomPaint({ this.callback, this.token, UINode child, Object key })
: super(child: child, key: key);
RenderCustomPaint get root { RenderCustomPaint result = super.root; return result; }
final CustomPaintCallback callback;
+ final dynamic token; // set this to be repainted automatically when the token changes
RenderCustomPaint createNode() => new RenderCustomPaint(callback: callback);
void syncRenderObject(CustomPaint old) {
super.syncRenderObject(old);
+ if (old != null && old.token != token)
+ root.markNeedsPaint();
root.callback = callback;
}
« sky/sdk/lib/framework/widgets/checkbox.dart ('K') | « sky/sdk/lib/framework/widgets/checkbox.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698