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

Unified Diff: tools/dom/templates/html/impl/impl_ClientRect.darttemplate

Issue 12493003: Exposing Point & Rect types (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Sync to ToT Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
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}
« no previous file with comments | « tools/dom/templates/html/dartium/impl_MouseEvent.darttemplate ('k') | tools/dom/templates/html/impl/impl_Touch.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698