summaryrefslogtreecommitdiff
path: root/apps/web/src/core/managers/timeline-manager.ts
diff options
context:
space:
mode:
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,