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

Side by Side Diff: samples/solar/web/solar.dart

Issue 13726010: Rename context2d to context2D. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | « runtime/bin/vmstats/bargraph.dart ('k') | samples/spirodraw/web/colorpicker.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 /** 5 /**
6 * A solar system visualization. 6 * A solar system visualization.
7 */ 7 */
8 8
9 library solar; 9 library solar;
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 void draw(num _) { 114 void draw(num _) {
115 num time = new DateTime.now().millisecondsSinceEpoch; 115 num time = new DateTime.now().millisecondsSinceEpoch;
116 116
117 if (renderTime != null) { 117 if (renderTime != null) {
118 showFps((1000 / (time - renderTime)).round()); 118 showFps((1000 / (time - renderTime)).round());
119 } 119 }
120 120
121 renderTime = time; 121 renderTime = time;
122 122
123 var context = canvas.context2d; 123 var context = canvas.context2D;
124 124
125 drawBackground(context); 125 drawBackground(context);
126 drawPlanets(context); 126 drawPlanets(context);
127 127
128 requestRedraw(); 128 requestRedraw();
129 } 129 }
130 130
131 void drawBackground(CanvasRenderingContext2D context) { 131 void drawBackground(CanvasRenderingContext2D context) {
132 context.clearRect(0, 0, width, height); 132 context.clearRect(0, 0, width, height);
133 } 133 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } else { 261 } else {
262 num angle = solarSystem.renderTime * orbitSpeed; 262 num angle = solarSystem.renderTime * orbitSpeed;
263 263
264 return new Point( 264 return new Point(
265 orbitRadius * cos(angle) + x, 265 orbitRadius * cos(angle) + x,
266 orbitRadius * sin(angle) + y); 266 orbitRadius * sin(angle) + y);
267 } 267 }
268 } 268 }
269 269
270 } 270 }
OLDNEW
« no previous file with comments | « runtime/bin/vmstats/bargraph.dart ('k') | samples/spirodraw/web/colorpicker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698