fix: adding check for link length to prevent early return (#4982)
Co-authored-by: Connor Hanafee <connorp@Connors-MacBook-Pro.local> Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
127af9db23
commit
580e719580
@ -2409,13 +2409,13 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
element.link &&
|
element.link &&
|
||||||
|
index <= hitElementIndex &&
|
||||||
isPointHittingLinkIcon(
|
isPointHittingLinkIcon(
|
||||||
element,
|
element,
|
||||||
this.state,
|
this.state,
|
||||||
[scenePointer.x, scenePointer.y],
|
[scenePointer.x, scenePointer.y],
|
||||||
this.deviceType.isMobile,
|
this.deviceType.isMobile,
|
||||||
) &&
|
)
|
||||||
index <= hitElementIndex
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -2443,7 +2443,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
this.state,
|
this.state,
|
||||||
);
|
);
|
||||||
const lastPointerDownHittingLinkIcon = isPointHittingLinkIcon(
|
const lastPointerDownHittingLinkIcon = isPointHittingLinkIcon(
|
||||||
this.hitLinkElement!,
|
this.hitLinkElement,
|
||||||
this.state,
|
this.state,
|
||||||
[lastPointerDownCoords.x, lastPointerDownCoords.y],
|
[lastPointerDownCoords.x, lastPointerDownCoords.y],
|
||||||
this.deviceType.isMobile,
|
this.deviceType.isMobile,
|
||||||
@ -2453,7 +2453,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
this.state,
|
this.state,
|
||||||
);
|
);
|
||||||
const lastPointerUpHittingLinkIcon = isPointHittingLinkIcon(
|
const lastPointerUpHittingLinkIcon = isPointHittingLinkIcon(
|
||||||
this.hitLinkElement!,
|
this.hitLinkElement,
|
||||||
this.state,
|
this.state,
|
||||||
[lastPointerUpCoords.x, lastPointerUpCoords.y],
|
[lastPointerUpCoords.x, lastPointerUpCoords.y],
|
||||||
this.deviceType.isMobile,
|
this.deviceType.isMobile,
|
||||||
|
@ -337,6 +337,9 @@ export const isPointHittingLinkIcon = (
|
|||||||
[x, y]: Point,
|
[x, y]: Point,
|
||||||
isMobile: boolean,
|
isMobile: boolean,
|
||||||
) => {
|
) => {
|
||||||
|
if (!element.link || appState.selectedElementIds[element.id]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const threshold = 4 / appState.zoom.value;
|
const threshold = 4 / appState.zoom.value;
|
||||||
if (
|
if (
|
||||||
!isMobile &&
|
!isMobile &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user