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:math' as math; | 5 import 'dart:math' as math; |
6 import 'dart:sky' as sky; | 6 import 'dart:sky' as sky; |
7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
8 import 'node.dart'; | 8 import 'node.dart'; |
9 import 'package:vector_math/vector_math.dart'; | 9 import 'package:vector_math/vector_math.dart'; |
10 | 10 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 child.hitTest(result, position: new sky.Point(position.x - child.parentD
ata.position.x, | 244 child.hitTest(result, position: new sky.Point(position.x - child.parentD
ata.position.x, |
245 position.y - child.parentD
ata.position.y)); | 245 position.y - child.parentD
ata.position.y)); |
246 } | 246 } |
247 } | 247 } |
248 } | 248 } |
249 | 249 |
250 } | 250 } |
251 | 251 |
252 // This must be immutable, because we won't notice when it changes | 252 // This must be immutable, because we won't notice when it changes |
253 class BoxDecoration { | 253 class BoxDecoration { |
254 // TODO(mpcomplete): go through and change the users of this class to pass | 254 const BoxDecoration({this.backgroundColor}); |
255 // a Color object. | |
256 BoxDecoration({ | |
257 backgroundColor | |
258 }) : backgroundColor = new sky.Color(backgroundColor); | |
259 | 255 |
260 final sky.Color backgroundColor; | 256 final sky.Color backgroundColor; |
261 } | 257 } |
262 | 258 |
263 class RenderDecoratedBox extends RenderProxyBox { | 259 class RenderDecoratedBox extends RenderProxyBox { |
264 | 260 |
265 RenderDecoratedBox({ | 261 RenderDecoratedBox({ |
266 BoxDecoration decoration, | 262 BoxDecoration decoration, |
267 RenderBox child | 263 RenderBox child |
268 }) : _decoration = decoration, super(child); | 264 }) : _decoration = decoration, super(child); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 457 |
462 void defaultPaint(RenderNodeDisplayList canvas) { | 458 void defaultPaint(RenderNodeDisplayList canvas) { |
463 RenderBox child = firstChild; | 459 RenderBox child = firstChild; |
464 while (child != null) { | 460 while (child != null) { |
465 assert(child.parentData is ParentDataType); | 461 assert(child.parentData is ParentDataType); |
466 canvas.paintChild(child, child.parentData.position); | 462 canvas.paintChild(child, child.parentData.position); |
467 child = child.parentData.nextSibling; | 463 child = child.parentData.nextSibling; |
468 } | 464 } |
469 } | 465 } |
470 } | 466 } |
OLD | NEW |