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

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: 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
« no previous file with comments | « sky/engine/core/painting/Point.cpp ('k') | sky/engine/core/painting/Rect.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bd404c740f5123e19e54b7b4b04faf4ca941c76a 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);
+ // does the equivalent of "return this - Point.origin"
+ Offset toOffset() => new Offset(x, y);
int get hashCode {
int result = 373;
« no previous file with comments | « sky/engine/core/painting/Point.cpp ('k') | sky/engine/core/painting/Rect.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698