From e08ffbf33311b973ed7d2dc30ffc09ca6fa41058 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 24 May 2026 16:42:53 +0000 Subject: [PATCH] Right-align FX rate and Amount labels in PDF to sit above their values Labels were left-aligned at c4 while values were flush-right, causing them to not line up. Labels now share the same right edge as their values. https://claude.ai/code/session_01MbwfxnjLA9KdFTrfzB55HM --- app/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/index.html b/app/index.html index cf93d31..90fa9b5 100644 --- a/app/index.html +++ b/app/index.html @@ -773,7 +773,7 @@ async function generatePDF() { pg.drawText('Date', {x:M.left+c1, y, size:szSm-1, font:fontBold, color:gray}); pg.drawText('Vendor', {x:M.left+c2, y, size:szSm-1, font:fontBold, color:gray}); pg.drawText('Currency', {x:M.left+c3, y, size:szSm-1, font:fontBold, color:gray}); - pg.drawText('FX rate', {x:M.left+c4, y, size:szSm-1, font:fontBold, color:gray}); + const fxLbl = 'FX rate'; pg.drawText(fxLbl, {x:M.left+W-fontBold.widthOfTextAtSize(fxLbl,szSm-1), y, size:szSm-1, font:fontBold, color:gray}); y -= lh; // Row 1 values const dateInPeriod = isDateInPeriod(ln.date); @@ -789,7 +789,7 @@ async function generatePDF() { // Row 2 labels: Description | Receipt | Amount pg.drawText('Description', {x:M.left, y, size:szSm-1, font:fontBold, color:gray}); pg.drawText('Receipt', {x:M.left+c3, y, size:szSm-1, font:fontBold, color:gray}); - pg.drawText('Amount', {x:M.left+c4, y, size:szSm-1, font:fontBold, color:gray}); + const amtLbl = 'Amount'; pg.drawText(amtLbl, {x:M.left+W-fontBold.widthOfTextAtSize(amtLbl,szSm-1), y, size:szSm-1, font:fontBold, color:gray}); y -= lh; // Row 2 values pg.drawText(truncate(ln.description, fontBody, sz, (c3)-8), {x:M.left, y, size:sz, font:fontBody, color:black});