fix: enlarge map resize handle
This commit is contained in:
parent
c87aa8f474
commit
023aef10ec
@ -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 ? (
|
||||
<rect
|
||||
className="location-map-resize-handle"
|
||||
x={object.x + object.width - 42}
|
||||
y={object.y + object.height - 42}
|
||||
width="38"
|
||||
height="38"
|
||||
rx="10"
|
||||
x={resizeHandleX}
|
||||
y={resizeHandleY}
|
||||
width={resizeHandleSize}
|
||||
height={resizeHandleSize}
|
||||
rx="8"
|
||||
onPointerDown={(event) => startDrag(event, object, "resize")}
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
/>
|
||||
|
||||
@ -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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user