Index: sky/engine/core/painting/Rect.dart |
diff --git a/sky/engine/core/painting/Rect.dart b/sky/engine/core/painting/Rect.dart |
index eb82fd44d16b6bfe255ae4858ab819f4fdd8fc64..5a7b6cb74e5b87150eba53044d805eafd5ae655d 100644 |
--- a/sky/engine/core/painting/Rect.dart |
+++ b/sky/engine/core/painting/Rect.dart |
@@ -6,14 +6,16 @@ part of dart.sky; |
/// Holds 4 floating-point coordinates for a rectangle. |
class Rect { |
- final Float32List _value = new Float32List(4); |
- double get left => _value[0]; |
- double get top => _value[1]; |
- double get right => _value[2]; |
- double get bottom => _value[3]; |
- |
Rect(); |
+ Rect.fromLTRB(double left, double top, double right, double bottom) { |
+ _value |
+ ..[0] = left |
+ ..[1] = top |
+ ..[2] = right |
+ ..[3] = bottom; |
+ } |
+ |
Rect.fromPointAndSize(Point point, Size size) { |
_value |
..[0] = point.x |
@@ -28,13 +30,11 @@ class Rect { |
..[3] = size.height; |
} |
- Rect.fromLTRB(double left, double top, double right, double bottom) { |
- _value |
- ..[0] = left |
- ..[1] = top |
- ..[2] = right |
- ..[3] = bottom; |
- } |
+ final Float32List _value = new Float32List(4); |
+ double get left => _value[0]; |
+ double get top => _value[1]; |
+ double get right => _value[2]; |
+ double get bottom => _value[3]; |
Point get upperLeft => new Point(left, top); |
Point get lowerRight => new Point(right, bottom); |
@@ -58,8 +58,6 @@ class Rect { |
return true; |
} |
- int get hashCode { |
- return _value.fold(373, (value, item) => (37 * value + item.hashCode)); |
- } |
+ int get hashCode =>_value.fold(373, (value, item) => (37 * value + item.hashCode)); |
String toString() => "Rect.fromLTRB($left, $top, $right, $bottom)"; |
} |