Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image gets distorted when downloaded if zoomed in browser (safari) #479

Open
nidhigoel-aq opened this issue May 28, 2024 · 1 comment
Open

Comments

@nidhigoel-aq
Copy link

Code

let chart_data = await domtoimage.toPng(document.getElementById('chart'),
{
width: clientwidth,
height: container.clientHeight * scale,
filter: (node: Node) => node !== action1 && node !== action2 && node !== action3 && node !== action4 && node !== action5 && node !== action7,
style: {
transform: 'scale(' + scale + ')'
}
}
);

saveAs(chart_data, chartName + '.png');

Expected Image

expected

Safari image

safari

Issue

I use this code to save element as png. It works well on all browsers except when Safari is zoomed in. Some elements tend to shift while downloading in such a case.

Is there something I'm doing wrong?

No error in console.

Browsers

Safari version 17.5

@forever0714yuan
Copy link

forever0714yuan commented May 28, 2024 via email

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

No branches or pull requests

2 participants