Chromium Code Reviews| Index: sky/engine/core/painting/Rect.dart |
| diff --git a/sky/engine/core/painting/Rect.dart b/sky/engine/core/painting/Rect.dart |
| index b0b7f7c40a0ffc78e7ea6aa061eb4368a8ba3d74..eb82fd44d16b6bfe255ae4858ab819f4fdd8fc64 100644 |
| --- a/sky/engine/core/painting/Rect.dart |
| +++ b/sky/engine/core/painting/Rect.dart |
| @@ -44,18 +44,22 @@ class Rect { |
| // Rects are inclusive of the top and left edges but exclusive of the bottom |
| // right edges. |
| - bool contains(Point point) => |
| - point.x >= left && point.x < right && point.y >= top && point.y < bottom; |
| + bool contains(Point point) { |
|
Matt Perry
2015/06/03 21:15:25
why this change?
Hixie
2015/06/09 21:06:49
Consistency. When it fits on one line, =>, when it
|
| + return point.x >= left && point.x < right && point.y >= top && point.y < bottom; |
| + } |
| bool operator ==(other) { |
| - if (!(other is Rect)) return false; |
| + if (other is! Rect) |
| + return false; |
| for (var i = 0; i < 4; ++i) { |
| - if (_value[i] != other._value[i]) return false; |
| + if (_value[i] != other._value[i]) |
| + return false; |
|
Matt Perry
2015/06/03 21:15:25
ditto?
Some of the formatting in this file was a
Hixie
2015/06/09 21:06:49
Having the if statement on the same line as the st
|
| } |
| return true; |
| } |
| + |
| int get hashCode { |
| return _value.fold(373, (value, item) => (37 * value + item.hashCode)); |
| } |
| - String toString() => "Rect.LTRB($left, $top, $right, $bottom)"; |
| + String toString() => "Rect.fromLTRB($left, $top, $right, $bottom)"; |
| } |