Skip to content

Commit 26ab7f9

Browse files
committed
Fix: formatting
1 parent 65c7660 commit 26ab7f9

File tree

1 file changed

+17
-27
lines changed

1 file changed

+17
-27
lines changed

src/legacy.ts

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,19 @@ const kSampleStepSize = 1.0 / (kSplineTableSize - 1.0)
1717

1818
const float32ArraySupported = typeof Float32Array === 'function'
1919

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
2925

3026
// 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
3429

3530
// 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)
3933

4034
const binarySubdivide = (aX, aA, aB, mX1, mX2) => {
4135
let currentX,
@@ -149,19 +143,15 @@ const getScheduler = scheduler => {
149143
return scheduler
150144
}
151145

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+
})
158150

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+
})
165155

166156
export const animate = (source, target, options) => {
167157
const start = Object.create(null)

0 commit comments

Comments
 (0)