krmanik / Anki-Occlusion

Image Occlusion for AnkiDroid
GNU General Public License v3.0
44 stars 0 forks source link

cannot deselect and delete occlusions #3

Open TristanTrim opened 3 years ago

TristanTrim commented 3 years ago

Seems exclusions stay selected when I create them and when I click delete it says "Select a figure" which doesn't seem possible. Screenshot_20210702-162049_Anki Image Occlusion Screenshot_20210702-162137_Settings

TristanTrim commented 3 years ago

I'm on a galaxy note 8 by the way. I think its handling of pennable input may be what's causing the problem, but idk.

krmanik commented 3 years ago

The problem is that when you click on screen to add a shape. Then SVG add multiple shape like circle at each corner and line etc. Also my implementation is buggy, it needs to implement considering data structures (push/pop of shape on screen) which I have not considered earlier.

The errors can be checked using chrome dev tools inspect tools for web app.

I will take a look the errors and improve the select/deselect features.

krmanik commented 3 years ago

You can try the latest release from GitHub or F-Droid. (May be it takes time to be processed on F-Droid) The delete function is improved.

To use

krmanik commented 3 years ago

I'm on a galaxy note 8 by the way. I think its handling of pennable input may be what's causing the problem, but idk.

The main problem was event listener. https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Using_Touch_Events

So, I added event listener to each shape when delete button selected. And remove it, when delete button deselected. View this for more. https://github.com/infinyte7/image-occlusion-in-browser/commit/1f1c2e0b2b17fda080e4740345c49dcf8b4f0a3d