diff --git a/examples/raw/render_paragraph.dart b/examples/raw/render_paragraph.dart index 32d6eebc4d0..f2e444d4a80 100644 --- a/examples/raw/render_paragraph.dart +++ b/examples/raw/render_paragraph.dart @@ -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() { diff --git a/examples/raw/sector-layout.dart b/examples/raw/sector-layout.dart index 36ee2af84a0..ae8b43fdf69 100644 --- a/examples/raw/sector-layout.dart +++ b/examples/raw/sector-layout.dart @@ -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() {