|
@@ -1,4 +1,5 @@
|
|
|
import Vec from '@tldraw/vec'
|
|
|
+import { transaction } from 'mobx'
|
|
|
import { TLApp, TLLineShape, TLLineShapeProps, TLShape, TLTool, TLToolState } from '~lib'
|
|
|
import type { TLBinding, TLEventMap, TLHandle, TLStateEvents } from '~types'
|
|
|
import { deepMerge, GeomUtils } from '~utils'
|
|
@@ -190,15 +191,17 @@ export class TLBaseLineBindingState<
|
|
|
|
|
|
updated = this.currentShape.getHandlesChange(next.shape, next.shape.handles)
|
|
|
|
|
|
- if (updated) {
|
|
|
- this.currentShape.update(updated)
|
|
|
- this.app.currentPage.updateBindings(next.bindings)
|
|
|
- this.app.setBindingShapes(
|
|
|
- Object.values(updated.handles ?? {})
|
|
|
- .map(h => next.bindings[h.bindingId!]?.toId)
|
|
|
- .filter(Boolean)
|
|
|
- )
|
|
|
- }
|
|
|
+ transaction(() => {
|
|
|
+ if (updated) {
|
|
|
+ this.currentShape.update(updated)
|
|
|
+ this.app.currentPage.updateBindings(next.bindings)
|
|
|
+ this.app.setBindingShapes(
|
|
|
+ Object.values(updated.handles ?? {})
|
|
|
+ .map(h => next.bindings[h.bindingId!]?.toId)
|
|
|
+ .filter(Boolean)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
onPointerUp: TLStateEvents<S, K>['onPointerUp'] = () => {
|