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 | 6 |
7 import 'box.dart'; | 7 import 'box.dart'; |
8 import 'object.dart'; | 8 import 'object.dart'; |
9 | 9 |
10 class StackParentData extends BoxParentData with ContainerParentDataMixin<Render
Box> { | 10 class StackParentData extends BoxParentData with ContainerParentDataMixin<Render
Box> { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 height = math.max(height, child.getMaxIntrinsicHeight(constraints)); | 100 height = math.max(height, child.getMaxIntrinsicHeight(constraints)); |
101 } | 101 } |
102 child = child.parentData.nextSibling; | 102 child = child.parentData.nextSibling; |
103 } | 103 } |
104 if (!hasNonPositionedChildren) | 104 if (!hasNonPositionedChildren) |
105 return constraints.constrainHeight(double.INFINITY); | 105 return constraints.constrainHeight(double.INFINITY); |
106 assert(height == constraints.constrainHeight(height)); | 106 assert(height == constraints.constrainHeight(height)); |
107 return height; | 107 return height; |
108 } | 108 } |
109 | 109 |
| 110 double getDistanceToActualBaseline(TextBaseline baseline) { |
| 111 return defaultGetDistanceToHighestActualBaseline(baseline); |
| 112 } |
| 113 |
110 void performLayout() { | 114 void performLayout() { |
111 bool hasNonPositionedChildren = false; | 115 bool hasNonPositionedChildren = false; |
112 | 116 |
113 double width = 0.0; | 117 double width = 0.0; |
114 double height = 0.0; | 118 double height = 0.0; |
115 | 119 |
116 RenderBox child = firstChild; | 120 RenderBox child = firstChild; |
117 while (child != null) { | 121 while (child != null) { |
118 assert(child.parentData is StackParentData); | 122 assert(child.parentData is StackParentData); |
119 final StackParentData parentData = child.parentData; | 123 final StackParentData parentData = child.parentData; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 194 } |
191 | 195 |
192 void hitTestChildren(HitTestResult result, { Point position }) { | 196 void hitTestChildren(HitTestResult result, { Point position }) { |
193 defaultHitTestChildren(result, position: position); | 197 defaultHitTestChildren(result, position: position); |
194 } | 198 } |
195 | 199 |
196 void paint(RenderCanvas canvas) { | 200 void paint(RenderCanvas canvas) { |
197 defaultPaint(canvas); | 201 defaultPaint(canvas); |
198 } | 202 } |
199 } | 203 } |
OLD | NEW |