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

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

Issue 1154213005: Add operator==, hashCode, and toString for Rect and Point dart classes. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: nits 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
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 a 2D floating-point size.
7 class Size { 8 class Size {
8 double width; 9 double width;
9 double height; 10 double height;
10 11
11 Point(this.width, this.height); 12 Size(this.width, this.height);
13
14 bool operator ==(other) {
15 if (!(other is Size)) return false;
16 return width == other.width && height == other.height;
17 }
18 int get hashCode {
19 int result = 373;
20 result = 37 * result + width.hashCode;
21 result = 37 * result + height.hashCode;
22 return result;
23 }
24 String toString() => "Size($width, $height)";
12 } 25 }
OLDNEW
« sky/engine/core/painting/Rect.dart ('K') | « sky/engine/core/painting/Rect.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698