perf(history): batch transform drag undo
This commit is contained in:
@@ -4,6 +4,7 @@ import { commandIds } from "./ids";
|
||||
export const historyUndoCommand: Command = {
|
||||
id: commandIds.historyUndo,
|
||||
name: "Undo",
|
||||
history: { mode: "ignore" },
|
||||
execute({ state }) {
|
||||
const previous = state.history.past.at(-1);
|
||||
if (!previous) return state;
|
||||
@@ -23,6 +24,7 @@ export const historyUndoCommand: Command = {
|
||||
export const historyRedoCommand: Command = {
|
||||
id: commandIds.historyRedo,
|
||||
name: "Redo",
|
||||
history: { mode: "ignore" },
|
||||
execute({ state }) {
|
||||
const next = state.history.future[0];
|
||||
if (!next) return state;
|
||||
|
||||
Reference in New Issue
Block a user