| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart.sky; | 5 part of dart.sky; |
| 6 | 6 |
| 7 /// Holds 2 floating-point coordinates. |
| 7 class Point { | 8 class Point { |
| 8 double x; | 9 double x; |
| 9 double y; | 10 double y; |
| 10 | 11 |
| 11 Point(this.x, this.y); | 12 Point(this.x, this.y); |
| 13 |
| 14 bool operator ==(other) { |
| 15 if (!(other is Point)) return false; |
| 16 return x == other.x && y == other.y; |
| 17 } |
| 18 int get hashCode { |
| 19 int result = 373; |
| 20 result = 37 * result + x.hashCode; |
| 21 result = 37 * result + y.hashCode; |
| 22 return result; |
| 23 } |
| 24 String toString() => "Point($x, $y)"; |
| 12 } | 25 } |
| OLD | NEW |