Merge pull request #10 from compliment/posterize
Fix(posterize): Resolve incorrect vertical tiling/cropping
This commit is contained in:
@@ -135,9 +135,12 @@ export async function posterize() {
|
||||
const offsetX = (targetWidth - scaledTileWidth) / 2;
|
||||
const offsetY = (targetHeight - scaledTileHeight) / 2;
|
||||
|
||||
const tileRowIndexFromBottom = rows - 1 - r;
|
||||
const overlapOffset = tileRowIndexFromBottom * overlapInPoints;
|
||||
|
||||
newPage.drawPage(embeddedPage, {
|
||||
x: -c * scaledTileWidth + offsetX - (c * overlapInPoints),
|
||||
y: r * scaledTileHeight + offsetY - ((rows - 1 - r) * overlapInPoints),
|
||||
y: -tileRowIndexFromBottom * scaledTileHeight + offsetY + overlapOffset,
|
||||
width: sourceWidth * scale,
|
||||
height: sourceHeight * scale,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user