diff --git a/frontend/src/components/maps/LocationMapCanvas.jsx b/frontend/src/components/maps/LocationMapCanvas.jsx index 606d9e9..119ce11 100644 --- a/frontend/src/components/maps/LocationMapCanvas.jsx +++ b/frontend/src/components/maps/LocationMapCanvas.jsx @@ -177,6 +177,22 @@ export default function LocationMapCanvas({ const countLabel = `${count} item${count === 1 ? "" : "s"}`; const labelLines = fittedLabelLines(object, "Area"); const countY = filters.showLabels && labelLines.length > 1 ? object.y + 76 : object.y + 52; + const resizeHandleSize = Math.min(96, Math.max(44, Math.ceil(48 / zoom))); + const resizeHandleInset = 6; + const resizeHandleX = Math.min( + Math.max(0, mapSize.width - resizeHandleSize), + Math.max( + object.x + resizeHandleInset, + object.x + object.width - resizeHandleSize - resizeHandleInset + ) + ); + const resizeHandleY = Math.min( + Math.max(0, mapSize.height - resizeHandleSize), + Math.max( + object.y + resizeHandleInset, + object.y + object.height - resizeHandleSize - resizeHandleInset + ) + ); const pinDots = filters.showPins ? zoneItems.slice(0, 12).map((item, itemIndex) => { const column = itemIndex % 4; @@ -233,11 +249,11 @@ export default function LocationMapCanvas({ {canEditObjects && isSelected ? ( startDrag(event, object, "resize")} onClick={(event) => event.stopPropagation()} /> diff --git a/frontend/tests/location-map-manager.spec.ts b/frontend/tests/location-map-manager.spec.ts index e6796c9..8180c70 100644 --- a/frontend/tests/location-map-manager.spec.ts +++ b/frontend/tests/location-map-manager.spec.ts @@ -298,6 +298,8 @@ test("admin creates a map from zones, saves a draft, and publishes it", async ({ const resizeHandle = page.locator(".location-map-resize-handle"); await expect(resizeHandle).toBeVisible(); + await expect(resizeHandle).toHaveAttribute("width", "64"); + await expect(resizeHandle).toHaveAttribute("height", "64"); const resizeBox = await resizeHandle.boundingBox(); expect(resizeBox).not.toBeNull(); if (!resizeBox) throw new Error("Resize handle was not measurable");