| Index: tools/dom/templates/html/impl/impl_ClientRect.darttemplate
|
| diff --git a/tools/dom/src/Rectangle.dart b/tools/dom/templates/html/impl/impl_ClientRect.darttemplate
|
| similarity index 76%
|
| copy from tools/dom/src/Rectangle.dart
|
| copy to tools/dom/templates/html/impl/impl_ClientRect.darttemplate
|
| index 857a1992ebe2fc215a6c21df44dc59fcca154365..33e362af57b2b4c43ab8adeff269928c584be004 100644
|
| --- a/tools/dom/src/Rectangle.dart
|
| +++ b/tools/dom/templates/html/impl/impl_ClientRect.darttemplate
|
| @@ -2,54 +2,13 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -part of html;
|
| -
|
| -/**
|
| - * A class for representing two-dimensional rectangles.
|
| - */
|
| -class Rect {
|
| - final num left;
|
| - final num top;
|
| - final num width;
|
| - final num height;
|
| -
|
| - Rect(this.left, this.top, this.width, this.height) {
|
| - if (width < 0) {
|
| - throw new ArgumentError(width);
|
| - }
|
| - if (height < 0) {
|
| - throw new ArgumentError(height);
|
| - }
|
| - }
|
| -
|
| - factory Rect.fromPoints(Point a, Point b) {
|
| - var left;
|
| - var width;
|
| - if (a.x < b.x) {
|
| - left = a.x;
|
| - width = b.x - left;
|
| - } else {
|
| - left = b.x;
|
| - width = a.x - left;
|
| - }
|
| - var top;
|
| - var height;
|
| - if (a.y < b.y) {
|
| - top = a.y;
|
| - height = b.y - top;
|
| - } else {
|
| - top = b.y;
|
| - height = a.y - top;
|
| - }
|
| -
|
| - return new Rect(left, top, width, height);
|
| - }
|
| +part of $LIBRARYNAME;
|
|
|
| - num get right => left + width;
|
| - num get bottom => top + height;
|
| +@DocsEditable
|
| +$(ANNOTATIONS)class $CLASSNAME implements Rect$IMPLEMENTS$NATIVESPEC {
|
|
|
| // NOTE! All code below should be common with Rect.
|
| - // TODO: implement with mixins when available.
|
| + // TODO(blois): implement with mixins when available.
|
|
|
| String toString() {
|
| return '($left, $top, $width, $height)';
|
| @@ -139,4 +98,4 @@ class Rect {
|
| Point get topLeft => new Point(this.left, this.top);
|
| Point get bottomRight => new Point(this.left + this.width,
|
| this.top + this.height);
|
| -}
|
| +$!MEMBERS}
|
|
|