mirror of
https://github.com/kbenestad/reimburse.git
synced 2026-06-18 16:04:31 +00:00
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.
This commit is contained in:
parent
f1d1ae71ee
commit
a94a2ed4eb
1 changed files with 5 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue