| Index: sky/engine/core/painting/Size.dart
|
| diff --git a/sky/engine/core/painting/Size.dart b/sky/engine/core/painting/Size.dart
|
| index 4b364bb009d090d0404dce9f03961fa8de31a499..0339cf20a696fe8710aa706c2b04225cf3bb18a9 100644
|
| --- a/sky/engine/core/painting/Size.dart
|
| +++ b/sky/engine/core/painting/Size.dart
|
| @@ -5,6 +5,7 @@
|
| part of dart.sky;
|
|
|
| /// Holds a 2D floating-point size.
|
| +/// Think of this as a vector from Point(0,0) to Point(size.width, size.height)
|
| class Size {
|
| final double width;
|
| final double height;
|
| @@ -16,10 +17,11 @@ class Size {
|
| const Size.fromWidth(this.width) : height = double.INFINITY;
|
| const Size.fromHeight(this.height) : width = double.INFINITY;
|
|
|
| - bool operator ==(other) {
|
| - if (!(other is Size)) return false;
|
| - return width == other.width && height == other.height;
|
| - }
|
| + bool operator ==(other) => other is Size && width == other.width && height == other.height;
|
| +
|
| + // does the equivalent of "return new Point(0,0) + this"
|
| + Point toPoint() => new Point(this.width, this.height);
|
| +
|
| int get hashCode {
|
| int result = 373;
|
| result = 37 * result + width.hashCode;
|
|
|