Commit 3f22019e authored by Adam Barth's avatar Adam Barth

Replace BoxDimensions with sky.Size

R=ianh@google.com

Review URL: https://codereview.chromium.org/1150253005
parent b0e39b7d
......@@ -16,10 +16,8 @@ class RenderSolidColor extends RenderDecoratedBox {
: backgroundColor = backgroundColor,
super(new BoxDecoration(backgroundColor: backgroundColor));
BoxDimensions getIntrinsicDimensions(BoxConstraints constraints) {
return new BoxDimensions.withConstraints(constraints,
height: desiredHeight,
width: desiredWidth);
Size getIntrinsicDimensions(BoxConstraints constraints) {
return constraints.constrain(new Size(desiredWidth, desiredHeight));
}
void performLayout() {
......
......@@ -398,16 +398,16 @@ class RenderBoxToRenderSectorAdapter extends RenderBox {
child.parentData = new SectorParentData();
}
BoxDimensions getIntrinsicDimensions(BoxConstraints constraints) {
sky.Size getIntrinsicDimensions(BoxConstraints constraints) {
if (child == null)
return new BoxDimensions.withConstraints(constraints, width: 0.0, height: 0.0);
return constraints.constrain(new sky.Size(0.0, 0.0));
assert(child is RenderSector);
assert(child.parentData is SectorParentData);
assert(!constraints.isInfinite);
double maxChildDeltaRadius = math.min(constraints.maxWidth, constraints.maxHeight) / 2.0 - innerRadius;
SectorDimensions childDimensions = child.getIntrinsicDimensions(new SectorConstraints(maxDeltaRadius: maxChildDeltaRadius), innerRadius);
double dimension = (innerRadius + childDimensions.deltaRadius) * 2.0;
return new BoxDimensions.withConstraints(constraints, width: dimension, height: dimension);
return constraints.constrain(new sky.Size(dimension, dimension));
}
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