summaryrefslogtreecommitdiff
path: root/apps/web/src/core/managers/timeline-manager.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-04-15 15:45:50 +0200
committerMaze Winther <mazewinther@gmail.com>2026-04-15 15:45:50 +0200
commitc46d28891fee62ca2d3132da876af6411a41d9da (patch)
treef856f71d04c69628f26b904088d675dd298a5080 /apps/web/src/core/managers/timeline-manager.ts
parent66e4367bc4727f1d0bcf8f869529c7518812277e (diff)
downloadopencut-c46d28891fee62ca2d3132da876af6411a41d9da.tar.gz
feat: text / custom masks, fix preview pan, refactor selection
Diffstat (limited to 'apps/web/src/core/managers/timeline-manager.ts')
-rw-r--r--apps/web/src/core/managers/timeline-manager.ts52
1 files changed, 52 insertions, 0 deletions
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,