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

Side by Side Diff: sky/examples/game/lib/sprite_box.dart

Issue 1180553002: Ink splashes should start at the touch point (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Use more specific types for GameBox and SpriteBox 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 unified diff | Download patch
OLDNEW
1 part of sprites; 1 part of sprites;
2 2
3 enum SpriteBoxTransformMode { 3 enum SpriteBoxTransformMode {
4 nativePoints, 4 nativePoints,
5 letterbox, 5 letterbox,
6 stretch, 6 stretch,
7 scaleToFit, 7 scaleToFit,
8 fixedWidth, 8 fixedWidth,
9 fixedHeight, 9 fixedHeight,
10 } 10 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 double get systemWidth => _systemWidth; 50 double get systemWidth => _systemWidth;
51 double get systemHeight => _systemHeight; 51 double get systemHeight => _systemHeight;
52 52
53 TransformNode get rootNode => _rootNode; 53 TransformNode get rootNode => _rootNode;
54 54
55 void performLayout() { 55 void performLayout() {
56 size = constraints.constrain(Size.infinite); 56 size = constraints.constrain(Size.infinite);
57 } 57 }
58 58
59 void handleEvent(Event event) { 59 void handleEvent(Event event, BoxHitTestData data) {
60 switch (event.type) { 60 switch (event.type) {
61 case 'pointerdown': 61 case 'pointerdown':
62 print("pointerdown"); 62 print("pointerdown");
63 break; 63 break;
64 } 64 }
65 } 65 }
66 66
67 void paint(RenderObjectDisplayList canvas) { 67 void paint(RenderObjectDisplayList canvas) {
68 // Move to correct coordinate space before drawing 68 // Move to correct coordinate space before drawing
69 double scaleX = 1.0; 69 double scaleX = 1.0;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // Count the number of frames we've been running 145 // Count the number of frames we've been running
146 _numFrames += 1; 146 _numFrames += 1;
147 147
148 // Print frame rate 148 // Print frame rate
149 if (_numFrames % 60 == 0) print("delta: ${delta} fps: ${1.0/delta}"); 149 if (_numFrames % 60 == 0) print("delta: ${delta} fps: ${1.0/delta}");
150 150
151 _rootNode.update(delta); 151 _rootNode.update(delta);
152 _scheduleTick(); 152 _scheduleTick();
153 } 153 }
154 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698