legalthings / angular-signature

HTML5 canvas based smooth signature drawing as angularJS directive (http://szimek.github.io/signature_pad/)
MIT License
105 stars 91 forks source link

onMouseup() outside the canvas isn't fired #44

Open paolosanchi opened 7 years ago

paolosanchi commented 7 years ago

If you fire the onMouseup event outside the canvas the updateModel() isn't called so if you accept() the sign it could be empty or wrong.. I've fixed adding modifying the accept() like this:


$scope.accept = function () {

    $scope.dataurl = $scope.signaturePad.isEmpty() ? EMPTY_IMAGE : $scope.signaturePad.toDataURL();
    return {
        isEmpty: $scope.dataurl === EMPTY_IMAGE,
        dataUrl: $scope.dataurl
    };
};
adrogon commented 6 years ago

Hello @paolosanchi, please advise whether #66 fixes your issue or not.

paolosanchi commented 6 years ago

No, I've updated to 1.0.3 and the issue is still there. Perhaps I wasn't so clear. See the attached animation as an explanation of the issue

issue

adrogon commented 6 years ago

You were very clear, #66 is an open PR so is not part of a release yet. So, would you be able to test the PR and provide your feedback? Thank you.

paolosanchi commented 6 years ago

oh, I tought it was merged. I checked your PR #66 and seems to work Thanks

adrogon commented 6 years ago

Thank you for your feedback, hope it gets through :smirk: