MarvinKlein1508 / SignaturePad

A simple to use blazor component to draw custom signatures.
MIT License
72 stars 12 forks source link

Fixed the issue of clearing the signature pad after screen rotation. #8

Closed AleBros closed 1 year ago

AleBros commented 1 year ago

I put this project inside a .net maui app and I realized that when the screen rotates the SignaturePad was cleared. My edit invokes the UpdateImage method in c# code, which requires the image redraw via javascript.

MarvinKlein1508 commented 1 year ago

Hi! Thanks for contributing!

I've took a look into your PR but I can't get it to work. Take a look at this: rotation

I'm not sure if this fix only applies for .NET MAUI.

This issue is bothering me for a while now. I couldn't figure out how to fix this one.

Could you maybe provide an example .NET MAUI project and instructions to check this?

AleBros commented 1 year ago

You are right. I think the point is that blazor is not aware of the state change when drawing, but it brings the image value after the "repaint" events. I'm adding a new pull request handling the resize event (that is fired in browser).