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

Unified Diff: sky/sdk/example/game/lib/sprite.dart

Issue 1216573009: Adds particle systems to sprites (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/sdk/example/game/lib/sprite.dart
diff --git a/sky/sdk/example/game/lib/sprite.dart b/sky/sdk/example/game/lib/sprite.dart
index bb022262f4de862054189b699eaf8d2daa279f38..0eea48006110fdd99f8bb659a3adafb37442a5d8 100644
--- a/sky/sdk/example/game/lib/sprite.dart
+++ b/sky/sdk/example/game/lib/sprite.dart
@@ -103,22 +103,7 @@ class Sprite extends NodeWithSize {
}
// Do actual drawing of the sprite
- if (texture.rotated) {
- // Calculate the rotated frame and spriteSourceSize
- Size originalFrameSize = texture.frame.size;
- Rect rotatedFrame = texture.frame.topLeft & new Size(originalFrameSize.height, originalFrameSize.width);
- Point rotatedSpriteSourcePoint = new Point(
- -texture.spriteSourceSize.top - (texture.spriteSourceSize.bottom - texture.spriteSourceSize.top),
- texture.spriteSourceSize.left);
- Rect rotatedSpriteSourceSize = rotatedSpriteSourcePoint & new Size(originalFrameSize.height, originalFrameSize.width);
-
- // Draw the rotated sprite
- canvas.rotate(-Math.PI/2.0);
- canvas.drawImageRect(texture.image, rotatedFrame, rotatedSpriteSourceSize, paint);
- } else {
- // Draw the sprite
- canvas.drawImageRect(texture.image, texture.frame, texture.spriteSourceSize, paint);
- }
+ texture.drawTexture(canvas, Point.origin, paint);
} else {
// Paint a red square for missing texture
canvas.drawRect(new Rect.fromLTRB(0.0, 0.0, size.width, size.height),

Powered by Google App Engine
This is Rietveld 408576698