diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-04-29 01:59:46 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-05-02 03:27:23 +0200 |
| commit | b8d08df244b97b1d3131cb2d076166838189eeb0 (patch) | |
| tree | 01f8ea0ce75c5a8b73e4b8d64c5456f40a2ff142 /apps/web/src/timeline/animation-targets.ts | |
| parent | 2ee0a44735d2b930348e9774909638b2c1909738 (diff) | |
| download | opencut-b8d08df244b97b1d3131cb2d076166838189eeb0.tar.gz | |
chore: cleanup
Diffstat (limited to 'apps/web/src/timeline/animation-targets.ts')
| -rw-r--r-- | apps/web/src/timeline/animation-targets.ts | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/apps/web/src/timeline/animation-targets.ts b/apps/web/src/timeline/animation-targets.ts index 8cccc78f..fcdb2915 100644 --- a/apps/web/src/timeline/animation-targets.ts +++ b/apps/web/src/timeline/animation-targets.ts @@ -23,9 +23,6 @@ import { } from "@/params"; import { getElementParam, - readElementParamValue, - writeElementParamValue, - type ElementParamDefinition, } from "@/params/registry"; import type { TimelineElement } from "@/timeline"; import { isVisualElement } from "@/timeline/element-utils"; @@ -96,35 +93,14 @@ function buildElementParamDescriptor({ return null; } - return buildTimelineElementParamDescriptor({ element, param }); -} - -function buildTimelineElementParamDescriptor({ - element, - param, -}: { - element: TimelineElement; - param: ElementParamDefinition; -}): AnimationPathDescriptor | null { - if (param.keyframable === false) { - return null; - } - - return { - kind: getParamValueKind({ param }), - defaultInterpolation: getParamDefaultInterpolation({ param }), - numericRanges: paramNumericRanges({ param }), - coerceValue: ({ value }) => coerceParamValue({ param, value }), - getBaseValue: () => readElementParamValue({ element, param }), - setBaseValue: ({ value }) => { - const coercedValue = coerceParamValue({ param, value }); - if (coercedValue === null) { - return element; - } - - return writeElementParamValue({ element, param, value: coercedValue }); - }, - }; + return buildParamDescriptor({ + param, + baseParams: element.params, + setParams: (params) => ({ + ...element, + params, + }), + }); } function buildGraphicParamDescriptor({ |
