Commit b7e81c79 authored by Adam Barth's avatar Adam Barth

Split getIntrinsicDimensions into four pieces

This CL splits getIntrinsicDimensions into getMinIntrinsicWidth,
getMaxIntrinsicWidth, getMinIntrinsicHeight, and getMaxIntrinsicHeight so that
we can properly shrink-wrap the stocks app menu. This CL just contains the
refactoring. The use in stocks app will come in a later CL.

R=ianh@google.com

Review URL: https://codereview.chromium.org/1167293003
parent 37f0b024
......@@ -13,8 +13,20 @@ class RenderSolidColorBox extends RenderDecoratedBox {
: backgroundColor = backgroundColor,
super(decoration: new BoxDecoration(backgroundColor: backgroundColor));
Size getIntrinsicDimensions(BoxConstraints constraints) {
return constraints.constrain(desiredSize);
double getMinIntrinsicWidth(BoxConstraints constraints) {
return constraints.constrainWidth(desiredSize.width);
}
double getMaxIntrinsicWidth(BoxConstraints constraints) {
return constraints.constrainWidth(desiredSize.width);
}
double getMinIntrinsicHeight(BoxConstraints constraints) {
return constraints.constrainHeight(desiredSize.height);
}
double getMaxIntrinsicHeight(BoxConstraints constraints) {
return constraints.constrainHeight(desiredSize.height);
}
void performLayout() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment