Browse Source

fix: persist rotating state

Peng Xiao 3 years ago
parent
commit
3eb4d38034

+ 4 - 0
tldraw/packages/core/src/lib/tools/TLSelectTool/states/PointingRotateHandleState.ts

@@ -25,6 +25,8 @@ export class PointingRotateHandleState<
   private handle = '' as TLSelectionHandle
 
   onEnter = (info: TLEventSelectionInfo) => {
+    // Pause the history when we enter
+    this.app.history.pause()
     this.handle = info.handle
     this.updateCursor()
   }
@@ -41,6 +43,8 @@ export class PointingRotateHandleState<
   }
 
   onPointerUp: TLEvents<S>['pointer'] = () => {
+    this.app.history.resume()
+    this.app.persist()
     this.tool.transition('idle')
   }