perf(history): batch transform drag undo
This commit is contained in:
@@ -24,6 +24,7 @@ export type TransformSetBoundsPayload = {
|
||||
export const transformBeginCommand: Command<TransformBeginPayload> = {
|
||||
id: commandIds.transformBegin,
|
||||
name: "Begin transform",
|
||||
history: { mode: "deferred", phase: "begin" },
|
||||
execute({ state }, payload) {
|
||||
return {
|
||||
...state,
|
||||
@@ -43,6 +44,7 @@ export const transformBeginCommand: Command<TransformBeginPayload> = {
|
||||
export const transformUpdateCommand: Command<TransformUpdatePayload> = {
|
||||
id: commandIds.transformUpdate,
|
||||
name: "Update transform",
|
||||
history: { mode: "deferred", phase: "update" },
|
||||
execute({ state }, payload) {
|
||||
const session = state.editor.transformSession;
|
||||
if (!session) return state;
|
||||
@@ -78,6 +80,7 @@ export const transformSetBoundsCommand: Command<TransformSetBoundsPayload> = {
|
||||
export const transformEndCommand: Command = {
|
||||
id: commandIds.transformEnd,
|
||||
name: "End transform",
|
||||
history: { mode: "deferred", phase: "commit" },
|
||||
execute({ state }) {
|
||||
if (!state.editor.transformSession) return state;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user