mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-29 00:54:44 +01:00
fix: Hovered arrow mode highlight
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
@@ -245,6 +245,8 @@ import {
|
||||
mutateElement,
|
||||
getElementBounds,
|
||||
doBoundsIntersect,
|
||||
isPointInElement,
|
||||
maxBindingGap_simple,
|
||||
} from "@excalidraw/element";
|
||||
|
||||
import type { GlobalPoint, LocalPoint, Radians } from "@excalidraw/math";
|
||||
@@ -6543,6 +6545,27 @@ class App extends React.Component<AppProps, AppState> {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.state.activeTool.type === "arrow") {
|
||||
const hit = getHoveredElementForBinding(
|
||||
pointFrom<GlobalPoint>(scenePointerX, scenePointerY),
|
||||
this.scene.getNonDeletedElements(),
|
||||
this.scene.getNonDeletedElementsMap(),
|
||||
(el) => maxBindingGap_simple(el, el.width, el.height, this.state.zoom),
|
||||
);
|
||||
if (
|
||||
hit &&
|
||||
!isPointInElement(
|
||||
pointFrom<GlobalPoint>(scenePointerX, scenePointerY),
|
||||
hit,
|
||||
this.scene.getNonDeletedElementsMap(),
|
||||
)
|
||||
) {
|
||||
this.setState({
|
||||
suggestedBinding: hit,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const hasDeselectedButton = Boolean(event.buttons);
|
||||
if (
|
||||
hasDeselectedButton ||
|
||||
|
||||
Reference in New Issue
Block a user