richrobber2 / canvas-zoom

zoom and pan functionality
351 stars 23 forks source link

Mobile gesture support #81

Closed auguster closed 10 months ago

auguster commented 1 year ago

Hello,

I'm using stable diffusion webui a lot on my phone and tablet and unfortunately the pinch gesture doesn't work anymore. It's frustrating because I want to inpaint using the touch screen, it's so much easier than the mouth to draw masks. It's also very practical to move around the canvas using zoom in and zoom out.

Also, on mobile, the UI button seems to move with the canvas instead of keeping their position, on large image, the UI get outside the view which is annoying also. This might be caused by the fact that the gesture are not handled as it should.

I remember that it used to work some times ago (but I can't remember when). I'll try to look into the code to maybe propose a PR but I don't know your code yet.

Best regards,

daswer123 commented 1 year ago

Hi, improved work a bit with canvas, but to me auto1111 doesn't seem very suitable for inpaint on a phone.

I've updated the code a bit and finalized the setting to add buttons, so that the picture would fit the screen.

Enable this item in the extension settings, then 2 buttons will appear: F - Fullscreen, P - Pippete.

https://github.com/richrobber2/canvas-zoom/assets/22278673/6d41d943-3b95-48b2-b5fb-3169ba6ecc88

P.S I tested on my phone works better than on the video, since I tested on pc with development tools

auguster commented 1 year ago

That was fast ! I will try this out, thanks !

auguster commented 1 year ago

I've test it out on my mobile and it's better than before but it's not very practical yet. The issue is that when the canvas is zoomed in too much, there is no more things to hang on.

I think I have an idea on the gesture that could be used to really make it good. I have to make some test to see how it works out.

I'll try to find the time to work on it this week to make a pull request.

daswer123 commented 1 year ago

I realize it's not the best solution :)

I'd welcome any PR

CCpt5 commented 1 year ago

Just updated, and on my computer if I open a Vertical image in controlnet (for instance to use controlnet inpaint), and then close that image and drag/drop a horizontal image, the box remains vertical and crops the sides off. Think the only way to reset it is to (S) enlarge it, and then (S) again.

If this is a local unreproducible issue my apologies.

Steps to reproduce:

Drag vertical image into Controlnet panel S to enlarge and draw S to shrink / generate etc. Drag/Drop a new horizontal image Notice image area remains vertical w/ exterior cropped until (S) opened, and (S) shrunk again.

daswer123 commented 1 year ago

I'll be working all day today, no chance to check and fix right now. I will check at the end of the day or tomorrow, thanks for reporting the problem.

daswer123 commented 1 year ago

@CCpt5 Fixed, this problem shouldn't be there now.

CCpt5 commented 1 year ago

Thanks for the fix on that. Personally never use mobile for SD, so running into another issue now where I have to enable the option to hide the buttons while drawing, only thing is the buttons disappear for good once they do - I can't get them back. On the commit prior to the mobile change I had the same issue but just disabled that feature in settings (and the buttons are way off to the side never in the way anyhow)

Again, not sure if that's just me, but if you can't reproduce then it's probably a conflict w/ another extension I have.

daswer123 commented 1 year ago

Don't worry, even if it happens only to you, it's still worth checking. As for hiding buttons, I added another trigger, maybe that will help.