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

Unified Diff: sky/sdk/lib/framework/rendering/box.dart

Issue 1166363002: Position the popup menu in stocks2 correctly (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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/fn2.dart ('k') | sky/sdk/lib/framework/rendering/flex.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/rendering/box.dart
diff --git a/sky/sdk/lib/framework/rendering/box.dart b/sky/sdk/lib/framework/rendering/box.dart
index 9822f70d3efa03e1d3bbfa3306ff25ce4aab3e06..e6810a3355a2e767710c94c8a0aaaccd5dab323a 100644
--- a/sky/sdk/lib/framework/rendering/box.dart
+++ b/sky/sdk/lib/framework/rendering/box.dart
@@ -86,8 +86,22 @@ class BoxConstraints {
}
BoxConstraints applyWidth(double width) {
- return new BoxConstraints(minWidth: width,
- maxWidth: width,
+ return new BoxConstraints(minWidth: math.max(minWidth, width),
+ maxWidth: math.min(maxWidth, width),
+ minHeight: minHeight,
+ maxHeight: maxHeight);
+ }
+
+ BoxConstraints applyMinWidth(double width) {
+ return new BoxConstraints(minWidth: math.max(minWidth, width),
+ maxWidth: maxWidth,
+ minHeight: minHeight,
+ maxHeight: maxHeight);
+ }
+
+ BoxConstraints applyMaxWidth(double width) {
+ return new BoxConstraints(minWidth: minWidth,
+ maxWidth: math.min(maxWidth, width),
minHeight: minHeight,
maxHeight: maxHeight);
}
@@ -95,8 +109,22 @@ class BoxConstraints {
BoxConstraints applyHeight(double height) {
return new BoxConstraints(minWidth: minWidth,
maxWidth: maxWidth,
- minHeight: height,
- maxHeight: height);
+ minHeight: math.max(minHeight, height),
+ maxHeight: math.min(maxHeight, height));
+ }
+
+ BoxConstraints applyMinHeight(double height) {
+ return new BoxConstraints(minWidth: minWidth,
+ maxWidth: maxWidth,
+ minHeight: math.max(minHeight, height),
+ maxHeight: maxHeight);
+ }
+
+ BoxConstraints applyMaxHeight(double height) {
+ return new BoxConstraints(minWidth: minWidth,
+ maxWidth: maxWidth,
+ minHeight: minHeight,
+ maxHeight: math.min(maxHeight, height));
}
final double minWidth;
« no previous file with comments | « sky/sdk/lib/framework/fn2.dart ('k') | sky/sdk/lib/framework/rendering/flex.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698