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

Unified Diff: sky/engine/core/painting/Point.dart

Issue 1214833004: Split Size into Size and Offset. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add the new files also Created 5 years, 6 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: sky/engine/core/painting/Point.dart
diff --git a/sky/engine/core/painting/Point.dart b/sky/engine/core/painting/Point.dart
index bb2cbd95c6984efbe1d98a2045bbb29ae786176a..fe4f5e2893cefc8050ca56a530b6ab269a44d5fe 100644
--- a/sky/engine/core/painting/Point.dart
+++ b/sky/engine/core/painting/Point.dart
@@ -14,11 +14,12 @@ class Point {
static const Point origin = const Point(0.0, 0.0);
bool operator ==(other) => other is Point && x == other.x && y == other.y;
- Size operator -(Point other) => new Size(x - other.x, y - other.y);
- Point operator +(Size size) => new Point(x + size.width, y + size.height);
+ Point operator -() => new Point(-x, -y);
+ Offset operator -(Point other) => new Offset(x - other.x, y - other.y);
+ Point operator +(Offset other) => new Point(x + other.dx, y + other.dy);
// does the equivalent of "return this - Point(0,0)"
- Size toSize() => new Size(x, y);
+ Offset toOffset() => new Offset(x, y);
int get hashCode {
int result = 373;

Powered by Google App Engine
This is Rietveld 408576698