From a94a2ed4eb99dc5c8fe1b9b9511a2a58a1a94054 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 24 May 2026 18:59:34 +0000 Subject: [PATCH] Fix item separator line overlapping last expense line of previous item y was at the stripe bottom when the separator was drawn at y+lh, landing inside the previous stripe. Dropping y by lh first puts the separator in the gap between the two items. --- app/index.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/index.html b/app/index.html index 3e7dd71..1a51661 100644 --- a/app/index.html +++ b/app/index.html @@ -954,8 +954,11 @@ async function generatePDF() { // Items state.items.forEach((item, itemIdx) => { // Item header - needSpace(lh * 6); // need room for at least header + one line - if (itemIdx > 0) pg.drawLine({start:{x:M.left, y:y+lh}, end:{x:M.left+W, y:y+lh}, thickness:0.75, color:accent}); + needSpace(lh * 7); // need room for separator gap + header + one line + if (itemIdx > 0) { + y -= lh; // create gap below previous item before drawing separator + pg.drawLine({start:{x:M.left, y:y+lh}, end:{x:M.left+W, y:y+lh}, thickness:0.75, color:accent}); + } pg.drawText('ITEM / PROJECT / TRAVEL', {x:M.left, y, size:sz, font:fontBold, color:accent}); const subStr = `Subtotal: ${baseCur} ${fmtAmt(item._subtotal)}`; const subW = fontBold.widthOfTextAtSize(subStr, sz);