Closed r-huang closed 5 years ago
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
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 https://github.com/agilgur5/react-signature-canvas/issues/6#issuecomment-380652924 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)
6
Have the canvas resize before drawing the canvas, will properly scale the image.