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

Unified Diff: client/base/Size.dart

Issue 8363040: Implement measurement using futures (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove duplicated imports from html.dart Created 9 years, 2 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
« no previous file with comments | « no previous file | client/base/base.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/base/Size.dart
diff --git a/client/touch/Geometry.dart b/client/base/Size.dart
similarity index 61%
copy from client/touch/Geometry.dart
copy to client/base/Size.dart
index c406f11136a25622f57ad063971b2844cb40db01..ca6624bcbbb693ac31dd667848f95838d889fbc8 100644
--- a/client/touch/Geometry.dart
+++ b/client/base/Size.dart
@@ -3,70 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
/**
- * Represents a point in 2 dimensional space.
- */
-class Coordinate {
-
- /**
- * X-value
- */
- num x;
-
- /**
- * Y-value
- */
- num y;
-
- Coordinate([num this.x = 0, num this.y = 0]) {
- }
-
- /**
- * Gets the coordinates of a touch's location relative to the window's
- * viewport. [input] is either a touch object or an event object.
- */
- Coordinate.fromClient(var input) : this(input.clientX, input.clientY);
-
- static Coordinate difference(Coordinate a, Coordinate b) {
- return new Coordinate(a.x - b.x, a.y - b.y);
- }
-
- static num distance(Coordinate a, Coordinate b) {
- final dx = a.x - b.x;
- final dy = a.y - b.y;
- return Math.sqrt(dx * dx + dy * dy);
- }
-
- bool operator ==(Coordinate other) {
- return other !== null && x == other.x && y == other.y;
- }
-
- static num squaredDistance(Coordinate a, Coordinate b) {
- final dx = a.x - b.x;
- final dy = a.y - b.y;
- return dx * dx + dy * dy;
- }
-
- static Coordinate sum(Coordinate a, Coordinate b) {
- return new Coordinate(a.x + b.x, a.y + b.y);
- }
-
- /**
- * Returns a new copy of the coordinate.
- */
- Coordinate clone() {
- return new Coordinate(x, y);
- }
-
- /**
- * Returns a nice string representing the coordinate.
- * @return {string} In the form (50, 73).
- */
- String toString() {
- return "(${x}, ${y})";
- }
-}
-
-/**
* A utility class for representing two-dimensional sizes.
*/
class Size {
@@ -200,35 +136,3 @@ class Size {
return "(${width} x ${height})";
}
}
-
-/**
- * Represents the interval { x | start <= x < end }.
- */
-class Interval {
-
- final num start;
- final num end;
-
- Interval(num this.start, num this.end) {}
-
- num get length() {
- return end - start;
- }
-
- bool operator ==(Interval other) {
- return other !== null && other.start == start && other.end == end;
- }
-
- Interval union(Interval other) {
- return new Interval(Math.min(start, other.start),
- Math.max(end, other.end));
- }
-
- bool contains(num value) {
- return value >= start && value < end;
- }
-
- String toString() {
- return '(${start}, ${end})';
- }
-}
« no previous file with comments | « no previous file | client/base/base.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698