From c46d28891fee62ca2d3132da876af6411a41d9da Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 15 Apr 2026 15:45:50 +0200 Subject: feat: text / custom masks, fix preview pan, refactor selection --- apps/web/src/core/managers/timeline-manager.ts | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'apps/web/src/core/managers/timeline-manager.ts') diff --git a/apps/web/src/core/managers/timeline-manager.ts b/apps/web/src/core/managers/timeline-manager.ts index c1398e8b..898a7e89 100644 --- a/apps/web/src/core/managers/timeline-manager.ts +++ b/apps/web/src/core/managers/timeline-manager.ts @@ -1,4 +1,5 @@ import type { EditorCore } from "@/core"; +import type { ElementBounds } from "@/lib/preview/element-bounds"; import type { ParamValues } from "@/lib/params"; import type { SceneTracks, @@ -44,6 +45,8 @@ import { RetimeKeyframeCommand, UpdateScalarKeyframeCurveCommand, AddClipEffectCommand, + DeleteCustomMaskPointsCommand, + InsertCustomMaskPointCommand, RemoveClipEffectCommand, UpdateClipEffectParamsCommand, ToggleClipEffectCommand, @@ -344,6 +347,55 @@ export class TimelineManager { this.editor.command.execute({ command }); } + deleteCustomMaskPoints({ + trackId, + elementId, + maskId, + pointIds, + }: { + trackId: string; + elementId: string; + maskId: string; + pointIds: string[]; + }): void { + if (pointIds.length === 0) { + return; + } + const command = new DeleteCustomMaskPointsCommand({ + trackId, + elementId, + maskId, + pointIds, + }); + this.editor.command.execute({ command }); + } + + insertCustomMaskPoint({ + trackId, + elementId, + maskId, + segmentIndex, + canvasPoint, + bounds, + }: { + trackId: string; + elementId: string; + maskId: string; + segmentIndex: number; + canvasPoint: { x: number; y: number }; + bounds: ElementBounds; + }): void { + const command = new InsertCustomMaskPointCommand({ + trackId, + elementId, + maskId, + segmentIndex, + canvasPoint, + bounds, + }); + this.editor.command.execute({ command }); + } + updateClipEffectParams({ trackId, elementId, -- cgit v1.3.1