Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 part of dart.sky; | |
| 6 | |
| 7 abstract class OffsetBase { | |
| 8 const OffsetBase(this._dx, this._dy); | |
| 9 | |
| 10 final double _dx; | |
| 11 final double _dy; | |
| 12 | |
| 13 bool get isInfinite => _dx >= double.INFINITY || _dy >= double.INFINITY; | |
| 14 | |
| 15 bool operator ==(other) { | |
| 16 return other is OffsetBase && | |
| 17 other.runtimeType == runtimeType && | |
| 18 other._dx == _dx && | |
| 19 other._dy == _dy; | |
| 20 } | |
| 21 | |
| 22 int get hashCode { | |
| 23 int result = 373; | |
|
Chinmay
2015/06/26 21:55:18
Maybe we should move this way of constructing hash
| |
| 24 result = 37 * result + _dx.hashCode; | |
| 25 result = 37 * result + _dy.hashCode; | |
| 26 return result; | |
| 27 } | |
| 28 } | |
| OLD | NEW |