| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:sky' as sky; | 5 import 'dart:sky' as sky; |
| 6 | 6 |
| 7 import 'package:vector_math/vector_math.dart'; | 7 import 'package:vector_math/vector_math.dart'; |
| 8 | 8 |
| 9 import '../painting/text_style.dart'; | 9 import '../painting/text_style.dart'; |
| 10 import '../rendering/block.dart'; | 10 import '../rendering/block.dart'; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 97 } |
| 98 | 98 |
| 99 } | 99 } |
| 100 | 100 |
| 101 class ClipRect extends OneChildRenderObjectWrapper { | 101 class ClipRect extends OneChildRenderObjectWrapper { |
| 102 ClipRect({ String key, Widget child }) | 102 ClipRect({ String key, Widget child }) |
| 103 : super(key: key, child: child); | 103 : super(key: key, child: child); |
| 104 | 104 |
| 105 RenderClipRect get root => super.root; | 105 RenderClipRect get root => super.root; |
| 106 RenderClipRect createNode() => new RenderClipRect(); | 106 RenderClipRect createNode() => new RenderClipRect(); |
| 107 |
| 108 // Nothing to sync, so we don't implement syncRenderObject() |
| 109 } |
| 110 |
| 111 class ClipRRect extends OneChildRenderObjectWrapper { |
| 112 final double xRadius; |
| 113 final double yRadius; |
| 114 ClipRRect({ String key, Widget child, this.xRadius, this.yRadius }) |
| 115 : super(key: key, child: child); |
| 116 |
| 117 RenderClipRRect get root => super.root; |
| 118 RenderClipRRect createNode() => new RenderClipRRect(xRadius: xRadius, yRadius:
yRadius); |
| 119 |
| 120 void syncRenderObject(ClipRRect old) { |
| 121 super.syncRenderObject(old); |
| 122 root.xRadius = xRadius; |
| 123 root.yRadius = yRadius; |
| 124 } |
| 107 } | 125 } |
| 108 | 126 |
| 109 class ClipOval extends OneChildRenderObjectWrapper { | 127 class ClipOval extends OneChildRenderObjectWrapper { |
| 110 ClipOval({ String key, Widget child }) | 128 ClipOval({ String key, Widget child }) |
| 111 : super(key: key, child: child); | 129 : super(key: key, child: child); |
| 112 | 130 |
| 113 RenderClipOval get root => super.root; | 131 RenderClipOval get root => super.root; |
| 114 RenderClipOval createNode() => new RenderClipOval(); | 132 RenderClipOval createNode() => new RenderClipOval(); |
| 133 |
| 134 // Nothing to sync, so we don't implement syncRenderObject() |
| 115 } | 135 } |
| 116 | 136 |
| 117 | |
| 118 // POSITIONING AND SIZING NODES | 137 // POSITIONING AND SIZING NODES |
| 119 | 138 |
| 120 class Transform extends OneChildRenderObjectWrapper { | 139 class Transform extends OneChildRenderObjectWrapper { |
| 121 | 140 |
| 122 Transform({ String key, this.transform, Widget child }) | 141 Transform({ String key, this.transform, Widget child }) |
| 123 : super(key: key, child: child); | 142 : super(key: key, child: child); |
| 124 | 143 |
| 125 RenderTransform get root => super.root; | 144 RenderTransform get root => super.root; |
| 126 final Matrix4 transform; | 145 final Matrix4 transform; |
| 127 | 146 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 150 } | 169 } |
| 151 | 170 |
| 152 } | 171 } |
| 153 | 172 |
| 154 class Center extends OneChildRenderObjectWrapper { | 173 class Center extends OneChildRenderObjectWrapper { |
| 155 Center({ String key, Widget child }) | 174 Center({ String key, Widget child }) |
| 156 : super(key: key, child: child); | 175 : super(key: key, child: child); |
| 157 | 176 |
| 158 RenderPositionedBox get root => super.root; | 177 RenderPositionedBox get root => super.root; |
| 159 RenderPositionedBox createNode() => new RenderPositionedBox(); | 178 RenderPositionedBox createNode() => new RenderPositionedBox(); |
| 179 |
| 180 // Nothing to sync, so we don't implement syncRenderObject() |
| 160 } | 181 } |
| 161 | 182 |
| 162 class SizedBox extends OneChildRenderObjectWrapper { | 183 class SizedBox extends OneChildRenderObjectWrapper { |
| 163 | 184 |
| 164 SizedBox({ | 185 SizedBox({ |
| 165 String key, | 186 String key, |
| 166 this.width, | 187 this.width, |
| 167 this.height, | 188 this.height, |
| 168 Widget child | 189 Widget child |
| 169 }) : super(key: key, child: child); | 190 }) : super(key: key, child: child); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 } | 492 } |
| 472 | 493 |
| 473 void remove() { | 494 void remove() { |
| 474 RenderObjectWrapper ancestor = findAncestor(RenderObjectWrapper); | 495 RenderObjectWrapper ancestor = findAncestor(RenderObjectWrapper); |
| 475 assert(ancestor is RenderObjectWrapper); | 496 assert(ancestor is RenderObjectWrapper); |
| 476 ancestor.detachChildRoot(this); | 497 ancestor.detachChildRoot(this); |
| 477 super.remove(); | 498 super.remove(); |
| 478 } | 499 } |
| 479 | 500 |
| 480 } | 501 } |
| OLD | NEW |