streamlit-drawable-canvas icon indicating copy to clipboard operation
streamlit-drawable-canvas copied to clipboard

rect drawing mode not working on mobile phone

Open HrsPythonix opened this issue 2 years ago • 4 comments

I tried the streamlit-drawable-canvas in https://drawable-canvas.streamlit.app/ on my mobile, but it only respond when under freedraw mode, the others were not working, any idea how to fix it?

HrsPythonix avatar Feb 02 '23 06:02 HrsPythonix

Hey @HrsPythonix Ah, I don't think the code works with mobile events, the underlying code uses a non-responsive library :/ lemme see

andfanilo avatar Feb 02 '23 07:02 andfanilo

Hey @HrsPythonix Ah, I don't think the code works with mobile events, the underlying code uses a non-responsive library :/ lemme see

@andfanilo I had aglance at your code, I find that you implement the rect drawing using mouse event (like mouse:down, mouse:move), I test my phone on http://fabricjs.com/events and it can trigger these event.

HrsPythonix avatar Feb 02 '23 08:02 HrsPythonix

@andfanilo https://github.com/andfanilo/streamlit-drawable-canvas/pull/106 I add this line to fix this problem in rect mode, I think this can also apply to other event-based drawing mode, but I haven't modify them. Maybe you can check and see if there are potential bugs

HrsPythonix avatar Feb 02 '23 11:02 HrsPythonix

Hello! Sorry I have seen the PR but had not have time to test it with all the components. I'll give you a sign when I do, or if you do it let me know! Thanks for the PR :)

andfanilo avatar Feb 20 '23 08:02 andfanilo