From 3f22019e66ea7e03f8983bba5cbdcf45863b4d4d Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 28 May 2015 14:29:29 -0700 Subject: [PATCH] Replace BoxDimensions with sky.Size R=ianh@google.com Review URL: https://codereview.chromium.org/1150253005 --- examples/raw/render_paragraph.dart | 6 ++---- examples/raw/sector-layout.dart | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) 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() {