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

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

Issue 1226113007: Add @override annotation to known overriden methods (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 | « sky/sdk/example/game/lib/particle_system.dart ('k') | sky/sdk/example/rendering/sector_layout.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0eea48006110fdd99f8bb659a3adafb37442a5d8..2f5ec5e3d5338e69c0bb21d0855521013b994ac5 100644
--- a/sky/sdk/example/game/lib/sprite.dart
+++ b/sky/sdk/example/game/lib/sprite.dart
@@ -64,6 +64,7 @@ class Sprite extends NodeWithSize {
_opacity = opacity;
}
+ @override
void paint(PaintingCanvas canvas) {
canvas.save();
@@ -75,10 +76,10 @@ class Sprite extends NodeWithSize {
double h = texture.size.height;
if (w <= 0 || h <= 0) return;
-
+
double scaleX = size.width / w;
double scaleY = size.height / h;
-
+
if (constrainProportions) {
// Constrain proportions, using the smallest scale and by centering the image
if (scaleX < scaleY) {
@@ -89,7 +90,7 @@ class Sprite extends NodeWithSize {
scaleX = scaleY;
}
}
-
+
canvas.scale(scaleX, scaleY);
// Setup paint object for opacity and transfer mode
« no previous file with comments | « sky/sdk/example/game/lib/particle_system.dart ('k') | sky/sdk/example/rendering/sector_layout.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698