mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix - binding to nonexistent element
This commit is contained in:
parent
d2f67e619f
commit
16c0417f5b
1 changed files with 3 additions and 0 deletions
|
@ -828,6 +828,9 @@ const bindingBorderTest = (
|
|||
{ x, y }: { x: number; y: number },
|
||||
app: AppClassProperties,
|
||||
): boolean => {
|
||||
if(!element || !element.width || !element.height) {
|
||||
return false;
|
||||
}
|
||||
const threshold = maxBindingGap(element, element.width, element.height);
|
||||
const shape = app.getElementShape(element);
|
||||
return isPointOnShape([x, y], shape, threshold);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue