Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1288)

Side by Side Diff: sky/engine/core/painting/Point.dart

Issue 1156303004: Use Point, Size, and Rect in layout2.dart (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sky/engine/core/painting/Size.dart » ('j') | sky/engine/core/painting/Size.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /// Holds 2 floating-point coordinates.
8 class Point { 8 class Point {
9 double x; 9 double x;
10 double y; 10 double y;
11 11
12 Point(this.x, this.y); 12 Point([this.x = 0.0, this.y = 0.0]);
Hixie 2015/05/28 18:45:21 I think we should make these required. These don't
13 13
14 bool operator ==(other) { 14 bool operator ==(other) {
15 if (!(other is Point)) return false; 15 if (!(other is Point)) return false;
16 return x == other.x && y == other.y; 16 return x == other.x && y == other.y;
17 } 17 }
18 int get hashCode { 18 int get hashCode {
19 int result = 373; 19 int result = 373;
20 result = 37 * result + x.hashCode; 20 result = 37 * result + x.hashCode;
21 result = 37 * result + y.hashCode; 21 result = 37 * result + y.hashCode;
22 return result; 22 return result;
23 } 23 }
24 String toString() => "Point($x, $y)"; 24 String toString() => "Point($x, $y)";
25 } 25 }
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/painting/Size.dart » ('j') | sky/engine/core/painting/Size.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698