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

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

Issue 1229783002: Add a function to Offset to get a new offset that is the old offset translated by some given values. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 | no next file » | 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 cd959753c145b5690f1a496a0e47333ea618e02f..823da122bffb3e443733853337326480b5b28db6 100644
--- a/sky/engine/core/painting/Offset.dart
+++ b/sky/engine/core/painting/Offset.dart
@@ -17,6 +17,7 @@ class Offset extends OffsetBase {
static const Offset infinite = const Offset(double.INFINITY, double.INFINITY);
Offset scale(double scaleX, double scaleY) => new Offset(dx * scaleX, dy * scaleY);
+ Offset translate(double translateX, double translateY) => new Offset(dx + translateX, dy + translateY);
Offset operator -() => new Offset(-dx, -dy);
Offset operator -(Offset other) => new Offset(dx - other.dx, dy - other.dy);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698