| OLD | NEW |
| 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 Loading... |
| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 root.src = src; | 367 root.src = src; |
| 366 root.requestedSize = size; | 368 root.requestedSize = size; |
| 367 } | 369 } |
| 368 | 370 |
| 369 void insert(RenderObjectWrapper child, dynamic slot) { | 371 void insert(RenderObjectWrapper child, dynamic slot) { |
| 370 assert(false); | 372 assert(false); |
| 371 // Image does not support having children currently | 373 // Image does not support having children currently |
| 372 } | 374 } |
| 373 | 375 |
| 374 } | 376 } |
| OLD | NEW |