diff --git a/frontend/src/canvas/PixiCanvas.tsx b/frontend/src/canvas/PixiCanvas.tsx index 6d447fb..4036fbe 100644 --- a/frontend/src/canvas/PixiCanvas.tsx +++ b/frontend/src/canvas/PixiCanvas.tsx @@ -205,8 +205,9 @@ const PixiCanvas = forwardRef( const nearbyItems = scene.queryRegion(qx, qy, qw, qh); for (const item of nearbyItems) { - const cx = item.data.x + (item.data.w * Math.abs(item.data.sx)) / 2; - const cy = item.data.y + (item.data.h * Math.abs(item.data.sy)) / 2; + const itemBounds = getItemWorldBounds(item); + const cx = itemBounds.x + itemBounds.w / 2; + const cy = itemBounds.y + itemBounds.h / 2; const dist = (cx - vcx) ** 2 + (cy - vcy) ** 2; if (item.type === 'image' && (item.displayObject instanceof ImageSprite || item.displayObject instanceof AnimatedGifSprite)) {