| 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 'box.dart'; | 5 import 'box.dart'; |
| 6 import 'object.dart'; | 6 import 'object.dart'; |
| 7 | 7 |
| 8 class StackParentData extends BoxParentData with ContainerParentDataMixin<Render
Box> { } | 8 class StackParentData extends BoxParentData with ContainerParentDataMixin<Render
Box> { } |
| 9 | 9 |
| 10 class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, S
tackParentData>, | 10 class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, S
tackParentData>, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 Size getIntrinsicDimensions(BoxConstraints constraints) { | 24 Size getIntrinsicDimensions(BoxConstraints constraints) { |
| 25 return constraints.constrain(Size.infinite); | 25 return constraints.constrain(Size.infinite); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void performLayout() { | 28 void performLayout() { |
| 29 size = constraints.constrain(Size.infinite); | 29 size = constraints.constrain(Size.infinite); |
| 30 assert(size.width < double.INFINITY); | 30 assert(size.width < double.INFINITY); |
| 31 assert(size.height < double.INFINITY); | 31 assert(size.height < double.INFINITY); |
| 32 BoxConstraints innerConstraints = new BoxConstraints.loose(size); | 32 BoxConstraints innerConstraints = new BoxConstraints.loose(size); |
| 33 | 33 |
| 34 Point origin = new Point(0.0, 0.0); | |
| 35 RenderBox child = firstChild; | 34 RenderBox child = firstChild; |
| 36 while (child != null) { | 35 while (child != null) { |
| 37 child.layout(innerConstraints); | 36 child.layout(innerConstraints); |
| 38 assert(child.parentData is StackParentData); | 37 assert(child.parentData is StackParentData); |
| 39 child.parentData.position = origin; | 38 child.parentData.position = Point.origin; |
| 40 child = child.parentData.nextSibling; | 39 child = child.parentData.nextSibling; |
| 41 } | 40 } |
| 42 } | 41 } |
| 43 | 42 |
| 44 void hitTestChildren(HitTestResult result, { Point position }) { | 43 void hitTestChildren(HitTestResult result, { Point position }) { |
| 45 defaultHitTestChildren(result, position: position); | 44 defaultHitTestChildren(result, position: position); |
| 46 } | 45 } |
| 47 | 46 |
| 48 void paint(RenderObjectDisplayList canvas) { | 47 void paint(RenderObjectDisplayList canvas) { |
| 49 defaultPaint(canvas); | 48 defaultPaint(canvas); |
| 50 } | 49 } |
| 51 } | 50 } |
| OLD | NEW |