From 86eabcb7c1bf19c10ef20359fb8f28002aa42765 Mon Sep 17 00:00:00 2001 From: Hixie Date: Mon, 15 Jun 2015 15:51:56 -0700 Subject: [PATCH] Remove RenderSizedBox. Make old users of RenderSizedBox use RenderConstrainedBox. Change the semantics of BoxDecoration.apply* to actually apply the provided constraints to the current constraints, rather than the previous behaviour of merging them neutrally. R=abarth@chromium.org Review URL: https://codereview.chromium.org/1189603003. --- examples/rendering/borders.dart | 20 ++++++++++---------- examples/rendering/transform.dart | 9 ++++++--- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/examples/rendering/borders.dart b/examples/rendering/borders.dart index 7bc72f3c4a..103100223d 100644 --- a/examples/rendering/borders.dart +++ b/examples/rendering/borders.dart @@ -16,8 +16,8 @@ void main() { var root = new RenderBlock(children: [ new RenderPadding( padding: new EdgeDims.all(10.0), - child: new RenderSizedBox( - desiredSize: new sky.Size.fromHeight(100.0), + child: new RenderConstrainedBox( + additionalConstraints: new BoxConstraints.tightFor(height: 100.0), child: new RenderDecoratedBox( decoration: new BoxDecoration( backgroundColor: new sky.Color(0xFFFFFF00) @@ -27,8 +27,8 @@ void main() { ), new RenderPadding( padding: new EdgeDims.all(10.0), - child: new RenderSizedBox( - desiredSize: new sky.Size.fromHeight(100.0), + child: new RenderConstrainedBox( + additionalConstraints: new BoxConstraints.tightFor(height: 100.0), child: new RenderDecoratedBox( decoration: new BoxDecoration( border: new Border( @@ -44,8 +44,8 @@ void main() { ), new RenderPadding( padding: new EdgeDims.all(10.0), - child: new RenderSizedBox( - desiredSize: new sky.Size.fromHeight(100.0), + child: new RenderConstrainedBox( + additionalConstraints: new BoxConstraints.tightFor(height: 100.0), child: new RenderDecoratedBox( decoration: new BoxDecoration( backgroundColor: new sky.Color(0xFFFFFF00) @@ -55,8 +55,8 @@ void main() { ), new RenderPadding( padding: new EdgeDims.all(10.0), - child: new RenderSizedBox( - desiredSize: new sky.Size.fromHeight(100.0), + child: new RenderConstrainedBox( + additionalConstraints: new BoxConstraints.tightFor(height: 100.0), child: new RenderDecoratedBox( decoration: new BoxDecoration( backgroundColor: new sky.Color(0xFFFFFF00) @@ -66,8 +66,8 @@ void main() { ), new RenderPadding( padding: new EdgeDims.all(10.0), - child: new RenderSizedBox( - desiredSize: new sky.Size.fromHeight(100.0), + child: new RenderConstrainedBox( + additionalConstraints: new BoxConstraints.tightFor(height: 100.0), child: new RenderDecoratedBox( decoration: new BoxDecoration( backgroundColor: new sky.Color(0xFFFFFF00) diff --git a/examples/rendering/transform.dart b/examples/rendering/transform.dart index 3d5250e060..7816b0859a 100644 --- a/examples/rendering/transform.dart +++ b/examples/rendering/transform.dart @@ -12,9 +12,12 @@ AppView app; void main() { RenderDecoratedBox green = new RenderDecoratedBox( - decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00))); - RenderSizedBox box = new RenderSizedBox( - desiredSize: new sky.Size(200.0, 200.0), child: green); + decoration: new BoxDecoration(backgroundColor: const sky.Color(0xFF00FF00)) + ); + RenderConstrainedBox box = new RenderConstrainedBox( + additionalConstraints: new BoxConstraints.tight(const Size(200.0, 200.0)), + child: green + ); Matrix4 transform = new Matrix4.identity(); RenderTransform spin = new RenderTransform(