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

canvas's origin is not at 0,0 #3033

Open
candy4290 opened this issue Mar 9, 2023 · 2 comments · May be fixed by #3034
Open

canvas's origin is not at 0,0 #3033

candy4290 opened this issue Mar 9, 2023 · 2 comments · May be fixed by #3034

Comments

@candy4290
Copy link

candy4290 commented Mar 9, 2023

Bug reports:

the canvas returned by html2canvas, it's origin is not at 0,0. When i draw on it again, it's a trouble。
(https://jsfiddle.net/xiaoxiang930601/mny3dro6/5/)

Specifications:

  • html2canvas version tested with: 1.4.1
  • Browser & version: chrome110.0.5481.178
  • Operating system: windows10
@candy4290
Copy link
Author

candy4290 commented Mar 9, 2023

I checked the source code and found the reason

this.ctx.translate(-options.x, -options.y);

I have an idea, before return canvas, reset the origin. I'll give a pr to this

@candy4290 candy4290 linked a pull request Mar 9, 2023 that will close this issue
5 tasks
@candy4290
Copy link
Author

anybody can help me to do a preview?

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

Successfully merging a pull request may close this issue.

1 participant