fix:shapaes bidings error

This commit is contained in:
DiamondThree
2022-08-18 18:22:52 +08:00
parent 5d32d656d5
commit 4724aee96e
5 changed files with 132 additions and 42 deletions
@@ -15,13 +15,13 @@ import {
TLPointerEventHandler,
TLShapeCloneHandler,
TLWheelEventHandler,
Utils,
Utils
} from '@tldraw/core';
import { Vec } from '@tldraw/vec';
import {
clearPrevSize,
defaultStyle,
shapeUtils,
shapeUtils
} from '@toeverything/components/board-shapes';
import {
AlignType,
@@ -54,7 +54,7 @@ import {
TDUser,
TldrawCommand,
USER_COLORS,
VIDEO_EXTENSIONS,
VIDEO_EXTENSIONS
} from '@toeverything/components/board-types';
import { MIN_PAGE_WIDTH } from '@toeverything/components/editor-core';
import {
@@ -67,7 +67,7 @@ import {
migrate,
openAssetFromFileSystem,
openFromFileSystem,
saveToFileSystem,
saveToFileSystem
} from './data';
import { getClipboard, setClipboard } from './idb-clipboard';
import { StateManager } from './manager/state-manager';
@@ -440,7 +440,6 @@ export class TldrawApp extends StateManager<TDSnapshot> {
if (visitedShapes.has(fromShape)) {
return;
}
// We only need to update the binding's "from" shape (an arrow)
const fromDelta = TLDR.update_arrow_bindings(
page,
@@ -856,14 +855,15 @@ export class TldrawApp extends StateManager<TDSnapshot> {
if (!page.bindings[binding.id]) {
return;
}
const fromShape = page.shapes[binding.fromId] as ArrowShape;
if (visitedShapes.has(fromShape)) {
return;
}
// We only need to update the binding's "from" shape (an arrow)
const fromDelta = TLDR.update_arrow_bindings(page, fromShape);
visitedShapes.add(fromShape);