mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-12-04 19:44:43 +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,
|
mutateElement,
|
||||||
getElementBounds,
|
getElementBounds,
|
||||||
doBoundsIntersect,
|
doBoundsIntersect,
|
||||||
|
isPointInElement,
|
||||||
|
maxBindingGap_simple,
|
||||||
} from "@excalidraw/element";
|
} from "@excalidraw/element";
|
||||||
|
|
||||||
import type { GlobalPoint, LocalPoint, Radians } from "@excalidraw/math";
|
import type { GlobalPoint, LocalPoint, Radians } from "@excalidraw/math";
|
||||||
@@ -6543,6 +6545,27 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
return;
|
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);
|
const hasDeselectedButton = Boolean(event.buttons);
|
||||||
if (
|
if (
|
||||||
hasDeselectedButton ||
|
hasDeselectedButton ||
|
||||||
|
|||||||
Reference in New Issue
Block a user