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

Side by Side Diff: sky/framework/animation/generators.dart

Issue 1017463002: Fix some checked mode errors in drawer.dart (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | sky/framework/components/drawer.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'curves.dart'; 5 import 'curves.dart';
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:math' as math; 7 import 'dart:math' as math;
8 import 'dart:sky' as sky; 8 import 'dart:sky' as sky;
9 import 'mechanics.dart'; 9 import 'mechanics.dart';
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool _done = false; 70 bool _done = false;
71 71
72 AnimationGenerator({ 72 AnimationGenerator({
73 this.initialDelay: 0.0, 73 this.initialDelay: 0.0,
74 this.duration, 74 this.duration,
75 this.begin: 0.0, 75 this.begin: 0.0,
76 this.end: 1.0, 76 this.end: 1.0,
77 this.curve: linear, 77 this.curve: linear,
78 Function onDone 78 Function onDone
79 }) { 79 }) {
80 assert(curve != null);
80 assert(duration != null && duration > 0.0); 81 assert(duration != null && duration > 0.0);
81 _generator = new FrameGenerator(onDone: onDone); 82 _generator = new FrameGenerator(onDone: onDone);
82 83
83 double startTime = 0.0; 84 double startTime = 0.0;
84 _stream = _generator.onTick.map((timeStamp) { 85 _stream = _generator.onTick.map((timeStamp) {
85 if (startTime == 0.0) 86 if (startTime == 0.0)
86 startTime = timeStamp; 87 startTime = timeStamp;
87 88
88 double t = (timeStamp - (startTime + initialDelay)) / duration; 89 double t = (timeStamp - (startTime + initialDelay)) / duration;
89 return math.max(0.0, math.min(t, 1.0)); 90 return math.max(0.0, math.min(t, 1.0));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 double _update(double timeStamp) { 144 double _update(double timeStamp) {
144 double previousTime = _previousTime; 145 double previousTime = _previousTime;
145 _previousTime = timeStamp; 146 _previousTime = timeStamp;
146 if (previousTime == 0.0) 147 if (previousTime == 0.0)
147 return timeStamp; 148 return timeStamp;
148 double deltaT = timeStamp - previousTime; 149 double deltaT = timeStamp - previousTime;
149 system.update(deltaT); 150 system.update(deltaT);
150 return timeStamp; 151 return timeStamp;
151 } 152 }
152 } 153 }
OLDNEW
« no previous file with comments | « no previous file | sky/framework/components/drawer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698