From 15d8a0bc3b8f3c7ecca1aaa53d9dd04a9533d6b1 Mon Sep 17 00:00:00 2001 From: Hardik Date: Sun, 21 Jun 2026 15:17:21 +0530 Subject: [PATCH] fix(po): place stamp clear of the signature (no overlap) Signatures/stamps aren't always transparent PNGs, so an opaque stamp would cover the signature/name where it overlapped. Position the stamp to the right of the centred signature with a 10px gap so it never overlays either. Co-Authored-By: Claude Opus 4.8 --- App/app/api/po/[id]/export/route.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/App/app/api/po/[id]/export/route.ts b/App/app/api/po/[id]/export/route.ts index beff233..d39a7e0 100644 --- a/App/app/api/po/[id]/export/route.ts +++ b/App/app/api/po/[id]/export/route.ts @@ -478,11 +478,14 @@ export async function GET(request: NextRequest, { params }: Props) { const sigExt = signatureBase64 ? scaleToBox(signatureSize ?? { width: 360, height: 96 }, 165, 44) : null; const sigLeft = sigExt ? Math.round((SIG_BLOCK_PX - sigExt.width) / 2) : 0; // centred over the name - // Stamp / seal — drawn FIRST so it sits BEHIND the signature, tucked to its right. + // Stamp / seal — placed to the RIGHT of the signature with a gap, so it never + // overlays the signature or name (stamps/signatures aren't always transparent PNGs). + // Still drawn before the signature so it layers behind if they ever touch. if (stampImg) { const stampExt = scaleToBox(stampImg, 80, 66); + const STAMP_GAP = 10; const stampLeft = sigExt - ? Math.min(SIG_BLOCK_PX - stampExt.width, sigLeft + sigExt.width - Math.round(stampExt.width * 0.35)) + ? Math.min(SIG_BLOCK_PX - stampExt.width, sigLeft + sigExt.width + STAMP_GAP) : SIG_BLOCK_PX - stampExt.width - 6; const stampId = wb.addImage({ base64: stampImg.base64,