fix: enables textboxes to be selected more easily

This commit is contained in:
Mark Mankarious
2023-09-02 10:59:49 +01:00
parent 20ac174704
commit 6c3a4ce6c9

View File

@@ -467,7 +467,11 @@ export const getItemAtTile = ({
if (node) return node;
const textBox = scene.textBoxes.find((tb) => {
const textBoxBounds = getBoundingBox([tb.tile, getTextBoxTo(tb)]);
const textBoxTo = getTextBoxTo(tb);
const textBoxBounds = getBoundingBox([
tb.tile,
{ x: Math.ceil(textBoxTo.x), y: Math.ceil(textBoxTo.y) }
]);
return isWithinBounds(tile, textBoxBounds);
});