Skip to content

Commit

Permalink
fucking ;s....
Browse files Browse the repository at this point in the history
  • Loading branch information
sithel committed Apr 12, 2024
1 parent e1641cd commit 4d33c36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -404,7 +404,7 @@ export class Book {
this.zip.file(`${this.filename}_typeset.pdf`, pdfBytes);
});
}
previewPdf = aggregate.duplex
previewPdf = aggregate.duplex;
};

await saveAggregate();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -594,7 +594,7 @@ export class Book {
});
drawRects.forEach((rect) => {
currPage.drawRectangle(rect);
})
});

if (alt) {
side2flag = !side2flag;
Expand Down
12 changes: 6 additions & 6 deletions src/utils/drawing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit 4d33c36

Please sign in to comment.