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

when loading fromDataURL, resize canvas before drawing image on canvas #10

Closed
wants to merge 1 commit into from

Conversation

r-huang
Copy link

@r-huang r-huang commented Jul 7, 2017

#6

Have the canvas resize before drawing the canvas, will properly scale the image.

@agilgur5
Copy link
Owner

Wouldn't not dividing the width and height by the ratio when drawing the image (just setting it canvas.width and canvas.height) do the same thing? The resize multiplies the width and height by ratio, so it seems like they're just cancelling each other out.

Just removing the division would also be a lot better than adding a resize as that's a new side effect with potentially unexpected bugs as a result

@agilgur5
Copy link
Owner

Revisited this recently. Going to close this out due to inactivity and since it no longer applies to the current repo as fromDataURL is now implemented by the upstream signature_pad as of v1.0.0. The upstream fix mentioned in #6 (comment) also resolves the same issue this resolves.

I'm also still unsure that resizing the canvas is the right fix, due to aforementioned side effects, as well as because resizeCanvas is already called once on componentDidMount (and has been since before this fork began)

@agilgur5 agilgur5 closed this May 24, 2019
@agilgur5 agilgur5 added the problem: stale Issue author has not responded label May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem: stale Issue author has not responded
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants