Fix text selection broken by PR1899 (#2011)
This commit is contained in:
parent
26f67d27ec
commit
8bbeb32e87
@ -48,9 +48,12 @@ export const hitTest = (
|
|||||||
): boolean => {
|
): boolean => {
|
||||||
// How many pixels off the shape boundary we still consider a hit
|
// How many pixels off the shape boundary we still consider a hit
|
||||||
const threshold = 10 / appState.zoom;
|
const threshold = 10 / appState.zoom;
|
||||||
const check = isElementDraggableFromInside(element, appState)
|
const check =
|
||||||
? isInsideCheck
|
element.type === "text"
|
||||||
: isNearCheck;
|
? isStrictlyInside
|
||||||
|
: isElementDraggableFromInside(element, appState)
|
||||||
|
? isInsideCheck
|
||||||
|
: isNearCheck;
|
||||||
const point: Point = [x, y];
|
const point: Point = [x, y];
|
||||||
return hitTestPointAgainstElement({ element, point, threshold, check });
|
return hitTestPointAgainstElement({ element, point, threshold, check });
|
||||||
};
|
};
|
||||||
@ -119,6 +122,10 @@ export const distanceToBindableElement = (
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isStrictlyInside = (distance: number, threshold: number): boolean => {
|
||||||
|
return distance < 0;
|
||||||
|
};
|
||||||
|
|
||||||
const isInsideCheck = (distance: number, threshold: number): boolean => {
|
const isInsideCheck = (distance: number, threshold: number): boolean => {
|
||||||
return distance < threshold;
|
return distance < threshold;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user