Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Size of downloaded image varying according to the zoom level of browser #231

Open
hasimpk opened this issue Nov 18, 2019 · 1 comment
Open

Comments

@hasimpk
Copy link

hasimpk commented Nov 18, 2019

No description provided.

@Abercus
Copy link

Abercus commented Dec 1, 2019

For a quick hack fix the devicePixelRatio to the actual size. This is the variable that changes when you change zoom in a browser. Change the following line:

https://github.com/exupero/saveSvgAsPng/blob/gh-pages/src/saveSvgAsPng.js#L315

const pixelRatio = window.devicePixelRatio || 1;

to not use the window.devicePixelRatio e.g.

const pixelRatio = 1;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants