aboutsummaryrefslogtreecommitdiff
path: root/src/fields/util.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-09-29 01:38:15 -0400
committerbobzel <zzzman@gmail.com>2021-09-29 01:38:15 -0400
commitaed57a2d6435007676409aeba562fc11d0c4a44d (patch)
treeb14f348cdb1dd78c6d044c0d40ee767888eab2bb /src/fields/util.ts
parentfaaa10bfeaf9c4a33a75884c3cf93eb3138464d1 (diff)
a number of undo/redo fixes for ink (snapping to tangent, add points, dragging tangents). also tried to make storage of undo events more efficient when dragging ink controls (avoid saving hundreds of copies of the InkField)
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r--src/fields/util.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts
index 3590c2dea..99dfc04d9 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -98,13 +98,12 @@ const _setterImpl = action(function (target: any, prop: string | symbol | number
} else {
DocServer.registerDocWithCachedUpdate(receiver, prop as string, curValue);
}
- !receiver[Initializing] && (!receiver[UpdatingFromServer] || receiver[ForceServerWrite]) && UndoManager.AddEvent({
- redo: () => receiver[prop] = value,
- undo: () => {
- // console.log("Undo: " + prop + " = " + curValue); // bcz: uncomment to log undo
- receiver[prop] = curValue;
- }
- });
+ !receiver[Initializing] && (!receiver[UpdatingFromServer] || receiver[ForceServerWrite]) &&
+ UndoManager.AddEvent({
+ redo: () => receiver[prop] = value,
+ undo: () => receiver[prop] = curValue,
+ prop: prop?.toString()
+ });
return true;
}
return false;