Index: sky/sdk/lib/framework/rendering/object.dart |
diff --git a/sky/sdk/lib/framework/rendering/object.dart b/sky/sdk/lib/framework/rendering/object.dart |
index c3dc2f094936ebba5789c670adfa2314868f6731..a13504c6063f60b3f516d682fc3a2480ff824111 100644 |
--- a/sky/sdk/lib/framework/rendering/object.dart |
+++ b/sky/sdk/lib/framework/rendering/object.dart |
@@ -4,6 +4,7 @@ |
import '../node.dart'; |
import '../scheduler.dart' as scheduler; |
+import 'dart:math' as math; |
Hixie
2015/06/11 22:14:10
see note above about conventions for import order
|
import 'dart:sky' as sky; |
import 'dart:sky' show Point, Size, Rect, Color, Paint, Path; |
export 'dart:sky' show Point, Size, Rect, Color, Paint, Path; |
@@ -266,6 +267,13 @@ class HitTestResult { |
} |
} |
+double clamp({double min: 0.0, double value: 0.0, double max: double.INFINITY}) { |
Hixie
2015/06/11 22:14:10
see note above about spaces around arguments
|
+ assert(min != null); |
+ assert(value != null); |
+ assert(max != null); |
+ return math.max(min, math.min(max, value)); |
+} |
+ |
// GENERIC MIXIN FOR RENDER NODES WITH ONE CHILD |