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

Unified Diff: sky/framework/animation/controller.sky

Issue 942413002: Port sky-drawer to Dart (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/framework/animation/controller.dart ('k') | sky/framework/animation/curves.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/animation/controller.sky
diff --git a/sky/framework/animation/controller.sky b/sky/framework/animation/controller.sky
deleted file mode 100644
index e21f89eeb2ae9834cc3636b40e1aac004db59fdf..0000000000000000000000000000000000000000
--- a/sky/framework/animation/controller.sky
+++ /dev/null
@@ -1,46 +0,0 @@
-<!--
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
--->
-<import src="timer.sky" as="AnimationTimer" />
-<script>
-module.exports = class AnimationController {
- constructor(delegate) {
- this.delegate_ = delegate;
- this.timer_ = new AnimationTimer(this);
- this.begin_ = 0;
- this.end_ = 0;
- this.curve_ = null;
- this.isAnimating = false;
- Object.preventExtensions(this);
- }
-
- start(options) {
- this.begin_ = options.begin;
- this.end_ = options.end;
- this.curve_ = options.curve;
- this.isAnimating = true;
- this.timer_.start(options.duration);
- }
-
- stop() {
- this.isAnimating = false;
- this.timer_.stop();
- }
-
- positionForTime_(t) {
- // Explicitly finish animations at |this.end_| in case the curve isn't an
- // exact numerical transform.
- if (t == 1)
- return this.end_;
- var curvedTime = this.curve_.transform(t);
- var begin = this.begin_;
- return begin + (this.end_ - begin) * curvedTime;
- }
-
- updateAnimation(t) {
- this.delegate_.updateAnimation(this.positionForTime_(t));
- }
-};
-</script>
« no previous file with comments | « sky/framework/animation/controller.dart ('k') | sky/framework/animation/curves.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698