| Index: sky/sdk/lib/animation/generators.dart
|
| diff --git a/sky/sdk/lib/animation/generators.dart b/sky/sdk/lib/animation/generators.dart
|
| index f7bf0f04ff16e8ff379a89db8df2e02073a408dd..542490eac353735bc93c38fff09ee4867bbb4cd1 100644
|
| --- a/sky/sdk/lib/animation/generators.dart
|
| +++ b/sky/sdk/lib/animation/generators.dart
|
| @@ -57,71 +57,6 @@ class FrameGenerator extends Generator {
|
| }
|
| }
|
|
|
| -class AnimationGenerator extends Generator {
|
| - Stream<double> get onTick => _stream;
|
| - final double initialDelay;
|
| - final double duration;
|
| - final double begin;
|
| - final double end;
|
| - final Curve curve;
|
| -
|
| - FrameGenerator _generator;
|
| - Stream<double> _stream;
|
| - bool _done = false;
|
| - double _lastTime;
|
| -
|
| - AnimationGenerator({
|
| - this.initialDelay: 0.0,
|
| - this.duration,
|
| - this.begin: 0.0,
|
| - this.end: 1.0,
|
| - this.curve: linear,
|
| - Function onDone
|
| - }) {
|
| - assert(curve != null);
|
| - assert(duration != null && duration > 0.0);
|
| - _generator = new FrameGenerator(onDone: onDone);
|
| -
|
| - double startTime = 0.0;
|
| - _stream = _generator.onTick.map((timeStamp) {
|
| - if (startTime == 0.0)
|
| - startTime = timeStamp;
|
| -
|
| - double t = (timeStamp - (startTime + initialDelay)) / duration;
|
| - _lastTime = t.clamp(0.0, 1.0);
|
| - return _lastTime;
|
| - })
|
| - .takeWhile(_checkForCompletion)
|
| - .where((t) => t >= 0.0)
|
| - .map(_transform);
|
| - }
|
| -
|
| - double get remainingTime {
|
| - if (_lastTime == null)
|
| - return duration;
|
| - return duration - _lastTime;
|
| - }
|
| -
|
| - void cancel() {
|
| - _generator.cancel();
|
| - }
|
| -
|
| - double _transform(double t) {
|
| - if (_done)
|
| - return end;
|
| - return begin + (end - begin) * curve.transform(t);
|
| - }
|
| -
|
| - // This is required because Dart Streams don't have takeUntil (inclusive).
|
| - bool _checkForCompletion(double t) {
|
| - if (_done)
|
| - return false;
|
| -
|
| - _done = t >= 1;
|
| - return true;
|
| - }
|
| -}
|
| -
|
| class Simulation extends Generator {
|
| Stream<double> get onTick => _stream;
|
| final System system;
|
|
|