From 4d33c3619007c8b24cb3cd50f6e66dca8278df17 Mon Sep 17 00:00:00 2001 From: Sithel Date: Thu, 11 Apr 2024 21:20:49 -0500 Subject: [PATCH] fucking ;s.... --- src/book.js | 8 ++++---- src/utils/drawing.js | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/book.js b/src/book.js index 56d28cf..549b6db 100644 --- a/src/book.js +++ b/src/book.js @@ -291,7 +291,7 @@ export class Book { */ async createoutputfiles(isPreview) { // set this to `true` to enable full-book previews (placeholder till it's in the UI) - const fullPreviewDevHack = true + const fullPreviewDevHack = true; const previewFrame = document.getElementById('pdf'); let previewPdf = null; @@ -404,7 +404,7 @@ export class Book { this.zip.file(`${this.filename}_typeset.pdf`, pdfBytes); }); } - previewPdf = aggregate.duplex + previewPdf = aggregate.duplex; }; await saveAggregate(); @@ -546,7 +546,7 @@ export class Book { const pdfEdgeMarks = config.pdfEdgeMarks; const cutmarks = config.cutmarks; const alt = config.alt; - const maxSigCount = config.maxSigCount + const maxSigCount = config.maxSigCount; let side2flag = config.side2flag; const block = config.embeddedPages.slice(block_start, block_end); @@ -594,7 +594,7 @@ export class Book { }); drawRects.forEach((rect) => { currPage.drawRectangle(rect); - }) + }); if (alt) { side2flag = !side2flag; diff --git a/src/utils/drawing.js b/src/utils/drawing.js index c44fad7..7032833 100644 --- a/src/utils/drawing.js +++ b/src/utils/drawing.js @@ -163,13 +163,13 @@ export function drawSigOrderMark(sigDetails, position, maxSigCount, w, suggested const top = drawSpineMark(true, position, w); const bottom = drawSpineMark(false, position, w); - let x = top.start.x - let y = top.start.y + let x = top.start.x; + let y = top.start.y; - const dist = (position.rotation == 0) ? top.start.y - bottom.start.y : top.start.x - bottom.start.x - let h = Math.min(suggested_h, dist/maxSigCount) + const dist = (position.rotation == 0) ? top.start.y - bottom.start.y : top.start.x - bottom.start.x; + let h = Math.min(suggested_h, dist/maxSigCount); const offset = h * sigDetails.signatureNum; - console.log("Looking at signature ",sigDetails.signatureNum," of ",maxSigCount," PDF top/bottom distance ",dist," results in ",h," (",suggested_h," vs ",(dist/maxSigCount),") order mark height w/ offset ",offset," (width ",w,")") + console.log("Looking at signature ",sigDetails.signatureNum," of ",maxSigCount," PDF top/bottom distance ",dist," results in ",h," (",suggested_h," vs ",(dist/maxSigCount),") order mark height w/ offset ",offset," (width ",w,")"); if (position.rotation == 0) { h = h * -1; @@ -178,7 +178,7 @@ export function drawSigOrderMark(sigDetails, position, maxSigCount, w, suggested const temp = h; h = w; w = temp * -1; - x -= offset + x -= offset; } return {