diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-02-08 22:21:17 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-02-08 22:21:17 +0100 |
| commit | e50a817b97b87baa0cd8fdde0fdb5d607143c1c3 (patch) | |
| tree | 8f33d19153be9a6d9fe81b1a7e7a54179ab88feb /apps/web/src/lib | |
| parent | 484ce47867b1c92c83e4cfab9fa8371bb6e68e12 (diff) | |
| download | opencut-e50a817b97b87baa0cd8fdde0fdb5d607143c1c3.tar.gz | |
add transform + few fixes
feat: transform
feat: batch command
fix: slider undo
fix: timeline zoom perf
refactor: make updateElement support multiple
Diffstat (limited to 'apps/web/src/lib')
| -rw-r--r-- | apps/web/src/lib/commands/batch-command.ts | 25 | ||||
| -rw-r--r-- | apps/web/src/lib/commands/index.ts | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/apps/web/src/lib/commands/batch-command.ts b/apps/web/src/lib/commands/batch-command.ts new file mode 100644 index 00000000..05b51d38 --- /dev/null +++ b/apps/web/src/lib/commands/batch-command.ts @@ -0,0 +1,25 @@ +import { Command } from "./base-command"; + +export class BatchCommand extends Command { + constructor(private commands: Command[]) { + super(); + } + + execute(): void { + for (const command of this.commands) { + command.execute(); + } + } + + undo(): void { + for (const command of [...this.commands].reverse()) { + command.undo(); + } + } + + redo(): void { + for (const command of this.commands) { + command.execute(); + } + } +} diff --git a/apps/web/src/lib/commands/index.ts b/apps/web/src/lib/commands/index.ts index 6700087b..03de07c4 100644 --- a/apps/web/src/lib/commands/index.ts +++ b/apps/web/src/lib/commands/index.ts @@ -1,4 +1,5 @@ export { Command } from "./base-command"; +export { BatchCommand } from "./batch-command"; export * from "./timeline"; export * from "./media"; |
