mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix text selection broken by PR1899 (#2011)
This commit is contained in:
parent
26f67d27ec
commit
8bbeb32e87
1 changed files with 10 additions and 3 deletions
|
@ -48,7 +48,10 @@ export const hitTest = (
|
|||
): boolean => {
|
||||
// How many pixels off the shape boundary we still consider a hit
|
||||
const threshold = 10 / appState.zoom;
|
||||
const check = isElementDraggableFromInside(element, appState)
|
||||
const check =
|
||||
element.type === "text"
|
||||
? isStrictlyInside
|
||||
: isElementDraggableFromInside(element, appState)
|
||||
? isInsideCheck
|
||||
: isNearCheck;
|
||||
const point: Point = [x, y];
|
||||
|
@ -119,6 +122,10 @@ export const distanceToBindableElement = (
|
|||
}
|
||||
};
|
||||
|
||||
const isStrictlyInside = (distance: number, threshold: number): boolean => {
|
||||
return distance < 0;
|
||||
};
|
||||
|
||||
const isInsideCheck = (distance: number, threshold: number): boolean => {
|
||||
return distance < threshold;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue