fix: pending review fixes for sticky notes (#4493)

This commit is contained in:
Aakansha Doshi
2021-12-28 16:24:44 +05:30
committed by GitHub
parent bae0e985b2
commit 63ce5b82d7
4 changed files with 3 additions and 26 deletions

View File

@ -75,7 +75,6 @@ export const getElementContainingPosition = (
elements: readonly ExcalidrawElement[],
x: number,
y: number,
excludedType?: ExcalidrawElement["type"],
) => {
let hitElement = null;
// We need to to hit testing from front (end of the array) to back (beginning of the array)
@ -84,13 +83,7 @@ export const getElementContainingPosition = (
continue;
}
const [x1, y1, x2, y2] = getElementAbsoluteCoords(elements[index]);
if (
x1 < x &&
x < x2 &&
y1 < y &&
y < y2 &&
elements[index].type !== excludedType
) {
if (x1 < x && x < x2 && y1 < y && y < y2) {
hitElement = elements[index];
break;
}