mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 12:49:25 +08:00
feat: 缓动函数加法与乘法
This commit is contained in:
parent
4bc4588cde
commit
67d425d4ab
@ -1,3 +1,4 @@
|
|||||||
|
import { TimingFn } from 'mutate-animate';
|
||||||
import { RenderAdapter } from './adapter';
|
import { RenderAdapter } from './adapter';
|
||||||
import { FloorViewport } from './preset/viewport';
|
import { FloorViewport } from './preset/viewport';
|
||||||
|
|
||||||
@ -12,3 +13,17 @@ export function enableViewport() {
|
|||||||
if (!adapter) return;
|
if (!adapter) return;
|
||||||
adapter.sync('disable');
|
adapter.sync('disable');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将两个缓动函数做加法
|
||||||
|
*/
|
||||||
|
export function AddTiming(timing1: TimingFn, timing2: TimingFn): TimingFn {
|
||||||
|
return (p: number) => timing1(p) + timing2(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将两个缓动函数做乘法
|
||||||
|
*/
|
||||||
|
export function multiplyTiming(timing1: TimingFn, timing2: TimingFn): TimingFn {
|
||||||
|
return (p: number) => timing1(p) * timing2(p);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user