| 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 Rect$IMPLEME
NTS$NATIVESPEC { | 8 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements Rectangle$IM
PLEMENTS$NATIVESPEC { |
| 9 | 9 |
| 10 // NOTE! All code below should be common with Rect. | 10 // NOTE! All code below should be common with RectangleBase. |
| 11 // TODO(blois): implement with mixins when available. | |
| 12 | |
| 13 String toString() { | 11 String toString() { |
| 14 return '($left, $top, $width, $height)'; | 12 return '($left, $top, $width, $height)'; |
| 15 } | 13 } |
| 16 | 14 |
| 17 bool operator ==(other) { | 15 bool operator ==(other) { |
| 18 if (other is !Rect) return false; | 16 if (other is !Rect) return false; |
| 19 return left == other.left && top == other.top && width == other.width && | 17 return left == other.left && top == other.top && width == other.width && |
| 20 height == other.height; | 18 height == other.height; |
| 21 } | 19 } |
| 22 | 20 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 * Truncates coordinates to integers and returns the result as a new | 93 * Truncates coordinates to integers and returns the result as a new |
| 96 * rectangle. | 94 * rectangle. |
| 97 */ | 95 */ |
| 98 Rect toInt() => new Rect(left.toInt(), top.toInt(), width.toInt(), | 96 Rect toInt() => new Rect(left.toInt(), top.toInt(), width.toInt(), |
| 99 height.toInt()); | 97 height.toInt()); |
| 100 | 98 |
| 101 Point get topLeft => new Point(this.left, this.top); | 99 Point get topLeft => new Point(this.left, this.top); |
| 102 Point get bottomRight => new Point(this.left + this.width, | 100 Point get bottomRight => new Point(this.left + this.width, |
| 103 this.top + this.height); | 101 this.top + this.height); |
| 104 $!MEMBERS} | 102 $!MEMBERS} |
| OLD | NEW |