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

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

Issue 11748016: Make ~/, round, ceil, floor, truncate return ints. Remove toInt. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Checked mode fixes. Created 7 years, 11 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
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 14 matching lines...) Expand all
25 /** 25 /**
26 * Display the animation's FPS in a div. 26 * Display the animation's FPS in a div.
27 */ 27 */
28 void showFps(num fps) { 28 void showFps(num fps) {
29 if (fpsAverage == null) { 29 if (fpsAverage == null) {
30 fpsAverage = fps; 30 fpsAverage = fps;
31 } 31 }
32 32
33 fpsAverage = fps * 0.05 + fpsAverage * 0.95; 33 fpsAverage = fps * 0.05 + fpsAverage * 0.95;
34 34
35 query("#notes").text = "${fpsAverage.round().toInt()} fps"; 35 query("#notes").text = "${fpsAverage.round()} fps";
36 } 36 }
37 37
38 // TODO: remove this once dart:html Point works cross-platform 38 // TODO: remove this once dart:html Point works cross-platform
39 class Point { 39 class Point {
40 num x, y; 40 num x, y;
41 41
42 Point(this.x, this.y); 42 Point(this.x, this.y);
43 } 43 }
44 44
45 /** 45 /**
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } else { 267 } else {
268 num angle = solarSystem.renderTime * orbitSpeed; 268 num angle = solarSystem.renderTime * orbitSpeed;
269 269
270 return new Point( 270 return new Point(
271 orbitRadius * cos(angle) + x, 271 orbitRadius * cos(angle) + x,
272 orbitRadius * sin(angle) + y); 272 orbitRadius * sin(angle) + y);
273 } 273 }
274 } 274 }
275 275
276 } 276 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698