Skip to content

Commit

Permalink
Merge pull request #127 from avhm/main
Browse files Browse the repository at this point in the history
Swap scale mechanism to use zoom instead of css transforms
  • Loading branch information
sibbl authored Aug 7, 2024
2 parents 885d0f9 + c9d90e8 commit 4d2224a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,7 @@ async function renderUrlToImageAsync(browser, pageConfig, url, path) {
await page.addStyleTag({
content: `
body {
width: calc(${size.width}px / ${pageConfig.scaling});
height: calc(${size.height}px / ${pageConfig.scaling});
transform-origin: 0 0;
transform: scale(${pageConfig.scaling});
zoom: ${pageConfig.scaling * 100}%;
overflow: hidden;
}`
});
Expand Down

0 comments on commit 4d2224a

Please sign in to comment.