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

Unified Diff: sky/examples/game/lib/node_with_size.dart

Issue 1179413009: Adds basic touch handling to sprites and optimizes transformations (Closed) Base URL: git@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
Index: sky/examples/game/lib/node_with_size.dart
diff --git a/sky/examples/game/lib/node_with_size.dart b/sky/examples/game/lib/node_with_size.dart
index 3a6849a954f68c06c8bb75a91fe6c81678341b58..e8577f390d214c9dd0539dcb5d3fa1b0a4d3f0fe 100644
--- a/sky/examples/game/lib/node_with_size.dart
+++ b/sky/examples/game/lib/node_with_size.dart
@@ -9,7 +9,9 @@ abstract class NodeWithSize extends Node {
pivot = Point.origin;
}
- NodeWithSize.withSize(Size this.size, [Point this.pivot]);
+ NodeWithSize.withSize(Size this.size, [Point this.pivot]) {
+ if (pivot == null) pivot = Point.origin;
+ }
void applyTransformForPivot(PictureRecorder canvas) {
if (pivot.x != 0 || pivot.y != 0) {

Powered by Google App Engine
This is Rietveld 408576698