mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: include borders when testing insides of a shape (#7865)
This commit is contained in:
parent
d917db438e
commit
4987cc53d0
1 changed files with 3 additions and 1 deletions
|
@ -62,7 +62,9 @@ export const hitElementItself = ({
|
||||||
frameNameBound = null,
|
frameNameBound = null,
|
||||||
}: HitTestArgs) => {
|
}: HitTestArgs) => {
|
||||||
let hit = shouldTestInside(element)
|
let hit = shouldTestInside(element)
|
||||||
? isPointInShape([x, y], shape)
|
? // Since `inShape` tests STRICTLY againt the insides of a shape
|
||||||
|
// we would need `onShape` as well to include the "borders"
|
||||||
|
isPointInShape([x, y], shape) || isPointOnShape([x, y], shape, threshold)
|
||||||
: isPointOnShape([x, y], shape, threshold);
|
: isPointOnShape([x, y], shape, threshold);
|
||||||
|
|
||||||
// hit test against a frame's name
|
// hit test against a frame's name
|
||||||
|
|
Loading…
Add table
Reference in a new issue