Closed akz92 closed 7 years ago
Thanks Lucas, will let you know when I've had some time to look into this
I investigated a little further and found that the problem is actually in szimek/signature_pad. The ratio used when calculating the width and height to use in drawImage
for some reason is 2
and that causes both width and height to be half of the actual values.
Removing the ratio and using the values of this._canvas.width
and this._canvas.height
fixed both the issue in my application and in the angular2-signaturepad-demo.
I didn't raise an issue there because I'm not able to test their latest release now, but since this issue isn't from this component I'm closing it.
Thanks a lot for the update and investigation
Hello @akz92 ! I am having the same issue and could not solve it. Can you please give us more details regarding the resolution? Where did you remove the Ratio as you said "Removing the ratio"
Thanks for your help I have opened a new issue just in case. https://github.com/wulfsolter/angular2-signaturepad/issues/46
No need for another issue. Closed #46 as a duplicate of this.
If there is an issue here at all, it seems to be upstream.
Can't comment further than the excellent summary made by @akz92
@alan345 I didn't touch this code since I created the issue, so I'm not really sure, but I believe it had to do with these lines from the fromDataURL
method:
var ratio = options.ratio || window.devicePixelRatio || 1;
var width = options.width || this._canvas.width / ratio;
var height = options.height || this._canvas.height / ratio;
These are the actual lines I'm using in my app, so if this is where the problem is they should help you :smiley:
thanks @akz92 !
@lathonez can you bump signaturepad to 2.3 in deps so ratio is available in options (and other fixes)? See https://github.com/szimek/signature_pad/blob/master/src/signature_pad.js#L101 docs seem outdated
oh wait, it was actually there in 2.2.0 :( it would be nice to update regardless
@DexterHaslem - commenting on closed issues is a great way of getting your comments ignored.
https://github.com/wulfsolter/angular2-signaturepad/issues/55
No idea when we'll have time to action this. The repo is FOSS and PRs are accepted.
Cheers
I am still facing the same issue in version 2.8.0. Can anyone tell me what is the status of this issue.
Why is it closed? Issue is still exist.
This should be reopened
When applying an image using the
fromDataURL
function, the image doesn't take the entire canvas dimension. To make sure the problem wasn't in my code I used the example project from the README and the problem persisted: