Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1765)

Unified Diff: sky/sdk/lib/framework/fn2.dart

Issue 1156303004: Use Point, Size, and Rect in layout2.dart (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address review comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/components2/scaffold.dart ('k') | sky/sdk/lib/framework/layout2.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/fn2.dart
diff --git a/sky/sdk/lib/framework/fn2.dart b/sky/sdk/lib/framework/fn2.dart
index ef76a543c56702c6314713396bfe02d8b9ab99e3..962c9efd6ac899427f752314e84b801690b8c110 100644
--- a/sky/sdk/lib/framework/fn2.dart
+++ b/sky/sdk/lib/framework/fn2.dart
@@ -943,24 +943,21 @@ class Text extends Component {
// for now, but only for now:
class RenderSolidColor extends RenderDecoratedBox {
- final double desiredHeight;
- final double desiredWidth;
+ final sky.Size desiredSize;
final int backgroundColor;
- RenderSolidColor(int backgroundColor, { this.desiredHeight: double.INFINITY,
- this.desiredWidth: double.INFINITY })
+ RenderSolidColor(int backgroundColor, { this.desiredSize })
: backgroundColor = backgroundColor,
super(new BoxDecoration(backgroundColor: backgroundColor));
BoxDimensions getIntrinsicDimensions(BoxConstraints constraints) {
return new BoxDimensions.withConstraints(constraints,
- height: desiredHeight,
- width: desiredWidth);
+ width: desiredSize.width,
+ height: desiredSize.height);
}
void performLayout() {
- width = constraints.constrainWidth(desiredWidth);
- height = constraints.constrainHeight(desiredHeight);
+ size = constraints.constrain(desiredSize);
}
void handlePointer(sky.PointerEvent event) {
@@ -982,7 +979,7 @@ class Rectangle extends RenderNodeWrapper {
final int color;
RenderSolidColor root;
- RenderSolidColor createNode() => new RenderSolidColor(color, desiredWidth: 40.0, desiredHeight: 130.0);
+ RenderSolidColor createNode() => new RenderSolidColor(color, desiredSize: new sky.Size(40.0, 130.0));
static final Rectangle _emptyRectangle = new Rectangle(0);
RenderNodeWrapper get emptyNode => _emptyRectangle;
« no previous file with comments | « sky/sdk/lib/framework/components2/scaffold.dart ('k') | sky/sdk/lib/framework/layout2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698