OLD | NEW |
1 part of touch; | |
2 | |
3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
4 // 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 |
5 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
6 | 4 |
7 /** | 5 /** |
8 * Functions to model constant acceleration as a cubic Bezier | 6 * Functions to model constant acceleration as a cubic Bezier |
9 * curve (http://en.wikipedia.org/wiki/Bezier_curve). These functions are | 7 * curve (http://en.wikipedia.org/wiki/Bezier_curve). These functions are |
10 * intended to generate the transition timing function for CSS transitions. | 8 * intended to generate the transition timing function for CSS transitions. |
11 * Please see | 9 * Please see |
12 * [http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag]. | 10 * [http://www.w3.org/TR/css3-transitions/#transition-timing-function_tag]. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // The intermediate control point must have coordinates within the | 105 // The intermediate control point must have coordinates within the |
108 // interval [0,1]. | 106 // interval [0,1]. |
109 assert(x >= 0 && x <= 1 && y >= 0 && y <= 1); | 107 assert(x >= 0 && x <= 1 && y >= 0 && y <= 1); |
110 num x1 = x * _TWO_THIRDS; | 108 num x1 = x * _TWO_THIRDS; |
111 num y1 = y * _TWO_THIRDS; | 109 num y1 = y * _TWO_THIRDS; |
112 num x2 = x1 + _ONE_THIRD; | 110 num x2 = x1 + _ONE_THIRD; |
113 num y2 = y1 + _ONE_THIRD; | 111 num y2 = y1 + _ONE_THIRD; |
114 return [x1, y1, x2, y2]; | 112 return [x1, y1, x2, y2]; |
115 } | 113 } |
116 } | 114 } |
OLD | NEW |