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

Side by Side Diff: sky/sdk/lib/framework/widgets/wrappers.dart

Issue 1182743002: Animate checkboxes (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/framework/widgets/checkbox.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 import 'package:vector_math/vector_math.dart'; 2 import 'package:vector_math/vector_math.dart';
3 3
4 import '../rendering/block.dart'; 4 import '../rendering/block.dart';
5 import '../rendering/box.dart'; 5 import '../rendering/box.dart';
6 import '../rendering/flex.dart'; 6 import '../rendering/flex.dart';
7 import '../rendering/object.dart'; 7 import '../rendering/object.dart';
8 import '../rendering/paragraph.dart'; 8 import '../rendering/paragraph.dart';
9 import '../rendering/stack.dart'; 9 import '../rendering/stack.dart';
10 import 'ui_node.dart'; 10 import 'ui_node.dart';
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 RenderDecoratedBox createNode() => new RenderDecoratedBox(decoration: decorati on); 43 RenderDecoratedBox createNode() => new RenderDecoratedBox(decoration: decorati on);
44 44
45 void syncRenderObject(DecoratedBox old) { 45 void syncRenderObject(DecoratedBox old) {
46 super.syncRenderObject(old); 46 super.syncRenderObject(old);
47 root.decoration = decoration; 47 root.decoration = decoration;
48 } 48 }
49 49
50 } 50 }
51 51
52 // TODO(jackson) need a mechanism for marking the RenderCustomPaint as needing p aint
53 class CustomPaint extends OneChildRenderObjectWrapper { 52 class CustomPaint extends OneChildRenderObjectWrapper {
54 53
55 CustomPaint({ this.callback, UINode child, Object key }) 54 CustomPaint({ this.callback, this.token, UINode child, Object key })
56 : super(child: child, key: key); 55 : super(child: child, key: key);
57 56
58 RenderCustomPaint get root { RenderCustomPaint result = super.root; return res ult; } 57 RenderCustomPaint get root { RenderCustomPaint result = super.root; return res ult; }
59 final CustomPaintCallback callback; 58 final CustomPaintCallback callback;
59 final dynamic token; // set this to be repainted automatically when the token changes
60 60
61 RenderCustomPaint createNode() => new RenderCustomPaint(callback: callback); 61 RenderCustomPaint createNode() => new RenderCustomPaint(callback: callback);
62 62
63 void syncRenderObject(CustomPaint old) { 63 void syncRenderObject(CustomPaint old) {
64 super.syncRenderObject(old); 64 super.syncRenderObject(old);
65 if (old != null && old.token != token)
66 root.markNeedsPaint();
65 root.callback = callback; 67 root.callback = callback;
66 } 68 }
67 69
68 void remove() { 70 void remove() {
69 root.callback = null; 71 root.callback = null;
70 super.remove(); 72 super.remove();
71 } 73 }
72 74
73 } 75 }
74 76
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 root.src = src; 381 root.src = src;
380 root.requestedSize = size; 382 root.requestedSize = size;
381 } 383 }
382 384
383 void insert(RenderObjectWrapper child, dynamic slot) { 385 void insert(RenderObjectWrapper child, dynamic slot) {
384 assert(false); 386 assert(false);
385 // Image does not support having children currently 387 // Image does not support having children currently
386 } 388 }
387 389
388 } 390 }
OLDNEW
« no previous file with comments | « 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