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

Side by Side Diff: samples/clock/web/numbers.dart

Issue 27441002: Removing setImmediate and hiding WindowTimers interface (take 2) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: The fix Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « samples/clock/web/clock.dart ('k') | samples/solar/web/solar.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of clock; 5 part of clock;
6 6
7 class ClockNumber { 7 class ClockNumber {
8 static const int WIDTH = 4; 8 static const int WIDTH = 4;
9 static const int HEIGHT = 7; 9 static const int HEIGHT = 7;
10 10
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 } 37 }
38 38
39 void setPixels(List<List<int>> px) { 39 void setPixels(List<List<int>> px) {
40 for (int y = 0; y < HEIGHT; ++y) { 40 for (int y = 0; y < HEIGHT; ++y) {
41 for (int x = 0; x < WIDTH; ++x) { 41 for (int x = 0; x < WIDTH; ++x) {
42 ImageElement img = imgs[y][x]; 42 ImageElement img = imgs[y][x];
43 43
44 if (pixels != null) { 44 if (pixels != null) {
45 if ((pixels[y][x] != 0) && (px[y][x] == 0)) { 45 if ((pixels[y][x] != 0) && (px[y][x] == 0)) {
46 window.setImmediate(() { 46 scheduleMicrotask(() {
47 var r = img.getBoundingClientRect(); 47 var r = img.getBoundingClientRect();
48 double absx = r.left; 48 double absx = r.left;
49 double absy = r.top; 49 double absy = r.top;
50 50
51 app.balls.add(absx, absy, ballColor); 51 app.balls.add(absx, absy, ballColor);
52 }); 52 });
53 } 53 }
54 } 54 }
55 55
56 img.src = px[y][x] != 0 ? Balls.PNGS[ballColor] : Balls.PNGS[6]; 56 img.src = px[y][x] != 0 ? Balls.PNGS[ballColor] : Balls.PNGS[6];
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 const[ 1, 1, 1, 1 ], 159 const[ 1, 1, 1, 1 ],
160 const[ 1, 0, 0, 1 ], 160 const[ 1, 0, 0, 1 ],
161 const[ 1, 0, 0, 1 ], 161 const[ 1, 0, 0, 1 ],
162 const[ 1, 1, 1, 1 ], 162 const[ 1, 1, 1, 1 ],
163 const[ 0, 0, 0, 1 ], 163 const[ 0, 0, 0, 1 ],
164 const[ 0, 0, 0, 1 ], 164 const[ 0, 0, 0, 1 ],
165 const[ 1, 1, 1, 1 ] 165 const[ 1, 1, 1, 1 ]
166 ] 166 ]
167 ]; 167 ];
168 } 168 }
OLDNEW
« no previous file with comments | « samples/clock/web/clock.dart ('k') | samples/solar/web/solar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698