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

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

Issue 1172173002: Clean up a bunch of our Dart code. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: upstream merge 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/object.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 93eee099a80233633fbf9ffe7c29d5d21e5bed98..5f3fc72c4547d13a088d11ba4fc27fbda6174b55 100644
--- a/sky/sdk/lib/framework/rendering/box.dart
+++ b/sky/sdk/lib/framework/rendering/box.dart
@@ -133,12 +133,19 @@ class BoxConstraints {
final double minHeight;
final double maxHeight;
+ static double _clamp({double min: 0.0, double value: 0.0, double max: double.INFINITY}) {
+ assert(min != null);
+ assert(value != null);
+ assert(max != null);
+ return math.max(min, math.min(max, value));
+ }
+
double constrainWidth(double width) {
- return clamp(min: minWidth, max: maxWidth, value: width);
+ return _clamp(min: minWidth, max: maxWidth, value: width);
}
double constrainHeight(double height) {
- return clamp(min: minHeight, max: maxHeight, value: height);
+ return _clamp(min: minHeight, max: maxHeight, value: height);
}
Size constrain(Size size) {
@@ -620,11 +627,13 @@ class Border {
this.bottom: BorderSide.none,
this.left: BorderSide.none
});
+
const Border.all(BorderSide side) :
top = side,
right = side,
bottom = side,
left = side;
+
final BorderSide top;
final BorderSide right;
final BorderSide bottom;
« no previous file with comments | « sky/sdk/lib/framework/fn2.dart ('k') | sky/sdk/lib/framework/rendering/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698