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

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

Issue 1211603003: Baby steps towards an odeon-like animation system. First victim: Drawer. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: abarth 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 | « no previous file | sky/sdk/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/Offset.dart
diff --git a/sky/engine/core/painting/Offset.dart b/sky/engine/core/painting/Offset.dart
index 6bbbbc8eb99f1e3b9780051e796567ffd8d5fdcd..cd959753c145b5690f1a496a0e47333ea618e02f 100644
--- a/sky/engine/core/painting/Offset.dart
+++ b/sky/engine/core/painting/Offset.dart
@@ -21,6 +21,10 @@ class Offset extends OffsetBase {
Offset operator -() => new Offset(-dx, -dy);
Offset operator -(Offset other) => new Offset(dx - other.dx, dy - other.dy);
Offset operator +(Offset other) => new Offset(dx + other.dx, dy + other.dy);
+ Offset operator *(double operand) => new Offset(dx * operand, dy * operand);
+ Offset operator /(double operand) => new Offset(dx / operand, dy / operand);
+ Offset operator ~/(double operand) => new Offset((dx ~/ operand).toDouble(), (dy ~/ operand).toDouble());
+ Offset operator %(double operand) => new Offset(dx % operand, dy % operand);
Rect operator &(Size other) => new Rect.fromLTWH(dx, dy, other.width, other.height);
// does the equivalent of "return new Point(0,0) + this"
« no previous file with comments | « no previous file | sky/sdk/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698