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

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

Issue 11770004: Rename Date to DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and keep Backwards-compatibility class Date. 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
« no previous file with comments | « samples/chat/dart_client/chat.dart ('k') | samples/clock/web/clock.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 int get clientWidth => window.innerWidth; 7 int get clientWidth => window.innerWidth;
8 8
9 int get clientHeight => window.innerHeight; 9 int get clientHeight => window.innerHeight;
10 10
(...skipping 13 matching lines...) Expand all
24 "images/ball-13acfa.png", "images/ball-265897.png", 24 "images/ball-13acfa.png", "images/ball-265897.png",
25 "images/ball-b6b4b5.png", "images/ball-c0000b.png", 25 "images/ball-b6b4b5.png", "images/ball-c0000b.png",
26 "images/ball-c9c9c9.png" 26 "images/ball-c9c9c9.png"
27 ]; 27 ];
28 28
29 DivElement root; 29 DivElement root;
30 num lastTime; 30 num lastTime;
31 List<Ball> balls; 31 List<Ball> balls;
32 32
33 Balls() : 33 Balls() :
34 lastTime = new Date.now().millisecondsSinceEpoch, 34 lastTime = new DateTime.now().millisecondsSinceEpoch,
35 balls = new List<Ball>() { 35 balls = new List<Ball>() {
36 root = new DivElement(); 36 root = new DivElement();
37 document.body.nodes.add(root); 37 document.body.nodes.add(root);
38 makeAbsolute(root); 38 makeAbsolute(root);
39 setElementSize(root, 0.0, 0.0, 0.0, 0.0); 39 setElementSize(root, 0.0, 0.0, 0.0, 0.0);
40 } 40 }
41 41
42 void tick(num now) { 42 void tick(num now) {
43 showFps(1000.0 / (now - lastTime + 0.01)); 43 showFps(1000.0 / (now - lastTime + 0.01));
44 44
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 y = clientHeight.toDouble(); 167 y = clientHeight.toDouble();
168 vy *= -RESTITUTION; 168 vy *= -RESTITUTION;
169 } 169 }
170 170
171 // Position the element. 171 // Position the element.
172 setElementPosition(elem, x - RADIUS, y - RADIUS); 172 setElementPosition(elem, x - RADIUS, y - RADIUS);
173 173
174 return true; 174 return true;
175 } 175 }
176 } 176 }
OLDNEW
« no previous file with comments | « samples/chat/dart_client/chat.dart ('k') | samples/clock/web/clock.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698