@@ -17,25 +17,19 @@ const kSampleStepSize = 1.0 / (kSplineTableSize - 1.0)
17
17
18
18
const float32ArraySupported = typeof Float32Array === 'function'
19
19
20
- const A = ( aA1 , aA2 ) => {
21
- return 1.0 - 3.0 * aA2 + 3.0 * aA1
22
- }
23
- const B = ( aA1 , aA2 ) => {
24
- return 3.0 * aA2 - 6.0 * aA1
25
- }
26
- const C = aA1 => {
27
- return 3.0 * aA1
28
- }
20
+ const A = ( aA1 , aA2 ) => 1.0 - 3.0 * aA2 + 3.0 * aA1
21
+
22
+ const B = ( aA1 , aA2 ) => 3.0 * aA2 - 6.0 * aA1
23
+
24
+ const C = aA1 => 3.0 * aA1
29
25
30
26
// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
31
- const calcBezier = ( aT , aA1 , aA2 ) => {
32
- return ( ( A ( aA1 , aA2 ) * aT + B ( aA1 , aA2 ) ) * aT + C ( aA1 ) ) * aT
33
- }
27
+ const calcBezier = ( aT , aA1 , aA2 ) =>
28
+ ( ( A ( aA1 , aA2 ) * aT + B ( aA1 , aA2 ) ) * aT + C ( aA1 ) ) * aT
34
29
35
30
// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
36
- const getSlope = ( aT , aA1 , aA2 ) => {
37
- return 3.0 * A ( aA1 , aA2 ) * aT * aT + 2.0 * B ( aA1 , aA2 ) * aT + C ( aA1 )
38
- }
31
+ const getSlope = ( aT , aA1 , aA2 ) =>
32
+ 3.0 * A ( aA1 , aA2 ) * aT * aT + 2.0 * B ( aA1 , aA2 ) * aT + C ( aA1 )
39
33
40
34
const binarySubdivide = ( aX , aA , aB , mX1 , mX2 ) => {
41
35
let currentX ,
@@ -149,19 +143,15 @@ const getScheduler = scheduler => {
149
143
return scheduler
150
144
}
151
145
152
- const rafScheduler = ( ) => {
153
- return {
154
- next : window . requestAnimationFrame . bind ( window ) ,
155
- cancel : window . cancelAnimationFrame . bind ( window ) ,
156
- }
157
- }
146
+ const rafScheduler = ( ) => ( {
147
+ next : window . requestAnimationFrame . bind ( window ) ,
148
+ cancel : window . cancelAnimationFrame . bind ( window ) ,
149
+ } )
158
150
159
- const timeoutScheduler = ( ) => {
160
- return {
161
- next : cb => setTimeout ( cb , 1000 / 60 ) ,
162
- cancel : id => clearTimeout ( id ) ,
163
- }
164
- }
151
+ const timeoutScheduler = ( ) => ( {
152
+ next : cb => setTimeout ( cb , 1000 / 60 ) ,
153
+ cancel : id => clearTimeout ( id ) ,
154
+ } )
165
155
166
156
export const animate = ( source , target , options ) => {
167
157
const start = Object . create ( null )
0 commit comments