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 | 7 |
8 import 'package:vector_math/vector_math.dart'; | 8 import 'package:vector_math/vector_math.dart'; |
9 | 9 |
10 import '../base/debug.dart'; | 10 import '../base/debug.dart'; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 maxHeight: math.max(maxHeight, newMinHeight)); | 156 maxHeight: math.max(maxHeight, newMinHeight)); |
157 } | 157 } |
158 | 158 |
159 BoxConstraints applyMaxHeight(double newMaxHeight) { | 159 BoxConstraints applyMaxHeight(double newMaxHeight) { |
160 return new BoxConstraints(minWidth: minWidth, | 160 return new BoxConstraints(minWidth: minWidth, |
161 maxWidth: maxWidth, | 161 maxWidth: maxWidth, |
162 minHeight: minHeight, | 162 minHeight: minHeight, |
163 maxHeight: math.min(maxHeight, newMaxHeight)); | 163 maxHeight: math.min(maxHeight, newMaxHeight)); |
164 } | 164 } |
165 | 165 |
| 166 BoxConstraints widthConstraints() => new BoxConstraints(minWidth: minWidth, ma
xWidth: maxWidth); |
| 167 |
| 168 BoxConstraints heightConstraints() => new BoxConstraints(minHeight: minHeight,
maxHeight: maxHeight); |
| 169 |
166 final double minWidth; | 170 final double minWidth; |
167 final double maxWidth; | 171 final double maxWidth; |
168 final double minHeight; | 172 final double minHeight; |
169 final double maxHeight; | 173 final double maxHeight; |
170 | 174 |
171 double constrainWidth(double width) { | 175 double constrainWidth(double width) { |
172 return clamp(min: minWidth, max: maxWidth, value: width); | 176 return clamp(min: minWidth, max: maxWidth, value: width); |
173 } | 177 } |
174 | 178 |
175 double constrainHeight(double height) { | 179 double constrainHeight(double height) { |
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 | 1109 |
1106 void defaultPaint(RenderObjectDisplayList canvas) { | 1110 void defaultPaint(RenderObjectDisplayList canvas) { |
1107 RenderBox child = firstChild; | 1111 RenderBox child = firstChild; |
1108 while (child != null) { | 1112 while (child != null) { |
1109 assert(child.parentData is ParentDataType); | 1113 assert(child.parentData is ParentDataType); |
1110 canvas.paintChild(child, child.parentData.position); | 1114 canvas.paintChild(child, child.parentData.position); |
1111 child = child.parentData.nextSibling; | 1115 child = child.parentData.nextSibling; |
1112 } | 1116 } |
1113 } | 1117 } |
1114 } | 1118 } |
OLD | NEW |