| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
| 6 | 6 |
| 7 @DocsEditable() | 7 @DocsEditable() |
| 8 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements Rectangle$IM
PLEMENTS$NATIVESPEC { | 8 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements Rectangle$IM
PLEMENTS$NATIVESPEC { |
| 9 | 9 |
| 10 // NOTE! All code below should be common with RectangleBase. | 10 // NOTE! All code below should be common with RectangleBase. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 var left = min(this.left, other.left); | 66 var left = min(this.left, other.left); |
| 67 var top = min(this.top, other.top); | 67 var top = min(this.top, other.top); |
| 68 | 68 |
| 69 return new Rectangle(left, top, right - left, bottom - top); | 69 return new Rectangle(left, top, right - left, bottom - top); |
| 70 } | 70 } |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * Tests whether `this` entirely contains [another]. | 73 * Tests whether `this` entirely contains [another]. |
| 74 */ | 74 */ |
| 75 bool contains(Rectangle<num> another) { | 75 bool containsRectangle(Rectangle<num> another) { |
| 76 return left <= another.left && | 76 return left <= another.left && |
| 77 left + width >= another.left + another.width && | 77 left + width >= another.left + another.width && |
| 78 top <= another.top && | 78 top <= another.top && |
| 79 top + height >= another.top + another.height; | 79 top + height >= another.top + another.height; |
| 80 } | 80 } |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * Tests whether [another] is inside or along the edges of `this`. | 83 * Tests whether [another] is inside or along the edges of `this`. |
| 84 */ | 84 */ |
| 85 bool containsPoint(Point<num> another) { | 85 bool containsPoint(Point<num> another) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); | 127 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); |
| 128 hash = hash ^ (hash >> 11); | 128 hash = hash ^ (hash >> 11); |
| 129 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); | 129 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); |
| 130 } | 130 } |
| 131 | 131 |
| 132 static int hash2(a, b) => finish(combine(combine(0, a), b)); | 132 static int hash2(a, b) => finish(combine(combine(0, a), b)); |
| 133 | 133 |
| 134 static int hash4(a, b, c, d) => | 134 static int hash4(a, b, c, d) => |
| 135 finish(combine(combine(combine(combine(0, a), b), c), d)); | 135 finish(combine(combine(combine(combine(0, a), b), c), d)); |
| 136 } | 136 } |
| OLD | NEW |