Open Pingou opened 7 months ago
I think the issue is that in the autoScaleCanvas function the style width and height are set to be the same dimensions as the canvas internal width/height, but it shouldn't. I changed it with some other stuff and it fixed my issue, feel free to look at my fork.
I advise that you should set width and height after the canvas is initialized,I have encountered similar problems before
If you set a custom width/height to the canvas, then use toDataURL, the image exported is wrong/not the same as the image shown.
Example:
`render() {
What is shown on the view:
The exported image (I removed transparency):
And what if I use scale? context.scale(this.canvasScaleWidth, this.canvasScaleHeight);
The view:
The exported image (I removed transparency):
Any idea how to fix? I know nothing about canvas and I was wondering what it is that you do with the matrix transformation in the source code, and if that may be the issue. Any idea @iddan? Thank you.