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

Unified Diff: samples/spirodraw/Spirodraw.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/solar/solar.dart ('k') | samples/sunflower/sunflower.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/spirodraw/Spirodraw.dart
diff --git a/samples/spirodraw/Spirodraw.dart b/samples/spirodraw/Spirodraw.dart
index 7461da88ce30add73258533e22a4dab574f5a3df..387cb2a13215ddfbb79fecc25578086ca03fee23 100644
--- a/samples/spirodraw/Spirodraw.dart
+++ b/samples/spirodraw/Spirodraw.dart
@@ -5,6 +5,7 @@
#library('spirodraw');
#import('dart:html');
+#import('dart:math', prefix: 'Math');
#source("ColorPicker.dart");
@@ -206,10 +207,11 @@ class Spirodraw {
* things too much.
*/
void lucky() {
- wheelRadiusSlider.valueAsNumber = Math.random() * 9;
- penRadiusSlider.valueAsNumber = Math.random() * 9;
- penWidthSlider.valueAsNumber = 1 + Math.random() * 9;
- colorPicker.selectedColor = colorPicker.getHexString(Math.random() * 215);
+ var rand = new Math.Random();
+ wheelRadiusSlider.valueAsNumber = rand.nextDouble() * 9;
+ penRadiusSlider.valueAsNumber = rand.nextDouble() * 9;
+ penWidthSlider.valueAsNumber = 1 + rand.nextDouble() * 9;
+ colorPicker.selectedColor = colorPicker.getHexString(rand.nextDouble() * 215);
start();
}
« no previous file with comments | « samples/solar/solar.dart ('k') | samples/sunflower/sunflower.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698