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

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

Issue 10829459: Deprecate Math object in corelib in favor of dart:math library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 4 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/spirodraw/Spirodraw.dart ('k') | samples/swarm/swarmlib.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 #library('sunflower'); 5 #library('sunflower');
6 6
7 #import('dart:html'); 7 #import('dart:html');
8 #import('dart:math', prefix: 'Math');
8 9
9 final SEED_RADIUS = 2; 10 final SEED_RADIUS = 2;
10 final SCALE_FACTOR = 4; 11 final SCALE_FACTOR = 4;
11 final TAU = Math.PI * 2; 12 final TAU = Math.PI * 2;
12 13
13 final MAX_D = 300; 14 final MAX_D = 300;
14 final ORANGE = "orange"; 15 final ORANGE = "orange";
15 16
16 num centerX, centerY; 17 num centerX, centerY;
17 int seeds = 0; 18 int seeds = 0;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 context.strokeStyle = ORANGE; 65 context.strokeStyle = ORANGE;
65 context.arc(x, y, SEED_RADIUS, 0, TAU, false); 66 context.arc(x, y, SEED_RADIUS, 0, TAU, false);
66 context.fill(); 67 context.fill();
67 context.closePath(); 68 context.closePath();
68 context.stroke(); 69 context.stroke();
69 } 70 }
70 71
71 void displaySeedCount(num seedCount) { 72 void displaySeedCount(num seedCount) {
72 query("#notes").text = "${seedCount} seeds"; 73 query("#notes").text = "${seedCount} seeds";
73 } 74 }
OLDNEW
« no previous file with comments | « samples/spirodraw/Spirodraw.dart ('k') | samples/swarm/swarmlib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698