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