thenickdude / chickenpaint

An HTML5 Port of the ChibiPaint multi-layer Oekaki painting tool
GNU General Public License v3.0
117 stars 21 forks source link

Palm rejection issues on Ipad #36

Closed gastronomical closed 3 years ago

gastronomical commented 3 years ago

Hello, thanks for creating this wonderful port of a beloved drawing applet!

I've noticed on Ipad + Apple Pencil, there's occasional palm rejection issues if your palm makes contact anywhere on the screen before the pen does. This can be observed as straight lines joining from where your palm makes contact to the initial mark of your pen. 1627964236945

Ipad adoption is increasing among artists so I think it'd be a worthwhile endeavor to improve palm rejection.

thenickdude commented 3 years ago

I think the best I can do there is hope that iOS Safari labels the pointer events with either pen or finger tags. I'll find a test you can use to identify if that is available.

gastronomical commented 3 years ago

Sounds good, I'll be happy to help.

thenickdude commented 3 years ago

Please try dragging your pointer around this page and see if the labelling distinguishes between your pen and finger touch, and if so let me know how it differs, or if possible take a screenshot:

https://patrickhlauke.github.io/touch/tracker/multi-touch-tracker-pointer-hud.html

gastronomical commented 3 years ago

Labelling indeed tells them apart. For curiosity, i found it supports multiple touches as well. E928302A-8141-4C42-B824-7AC866032822 8E8321A3-35FA-4F9E-B9F3-7BA56F18D641 8342AFCE-5AAF-4945-9D14-457A03364BDB 54103732-5CCD-4381-AD10-6E3EE9035983

thenickdude commented 3 years ago

Okay, I should be able to automatically disable touch if a pen is detected then, thanks!

It's interesting that the touch pressure events don't include any pressure information... I assume that attempting to draw with them creates an extremely thin line unless the "enable pressure" tickbox next to "brush size" is deselected? On my Android I get pressure information corresponding to how large the contact area is between my finger and the device.

gastronomical commented 3 years ago

I assume that attempting to draw with them creates an extremely thin line unless the "enable pressure" tickbox next to "brush size" is deselected?

That’s correct. As its selected it behaves as the brush is 1px, regardless of brush size. also if opacity is set, lines become invisible with touch. C6D5984C-D319-4B01-A477-3F4F0798A228

When opacity is disabled, a weird (but cool) back and forth line pattern occurs when drawing with two fingers seen above.

satopian commented 3 years ago

The images have already been submitted, but I will also submit a video for the test taken by my acquaintance. For Chickenpaint Official. Palm test movie01. / Twitter

thenickdude commented 3 years ago

Please try the latest version here (you'll need to refresh the page to get the new code):

https://thenickdude.github.io/chickenpaint-example/

When it sees a pen present (i.e. it is seen hovering over the display) it should now disable touch-drawing for the rest of the session. I've also fixed the pressure readings when drawing using fingers so the lines should no longer be invisible or tiny when not using a pen.

gastronomical commented 3 years ago

Palm rejection issue still exists. I’m not sure if it has to do with their pencil technology (AES is not detected until it touches the display). Opacity causing invisible lines seems to be fixed except for pencil and watercolour brush. However turning on pressure still results in 1px lines.

thenickdude commented 3 years ago

This really sounds like the previous unfixed version of the code is being run, maybe try using Incognito mode (this effectively clears your cache for the session)

satopian commented 3 years ago

I asked a Japanese drawing board user who uses an iPad to try it. It seems that the problem of palm rejection, the problem of double tap zoom, and the problem of screen selection have all been solved.

gastronomical commented 3 years ago

Im still getting the same behaviour after turning off and turning on the device. I did incognito mode and shift refresh with no luck. Maybe I simply can’t get the cache to refresh if another user is reporting it fixed.

thenickdude commented 3 years ago

Which iOS version?

I've pushed a new version of the chickenpaint example now which bumps the resource URLs. This should force them to be loaded fresh instead of re-used from cache, you could give it another go:

https://thenickdude.github.io/chickenpaint-example/?1

You can tell you're running the new version if the heading at the top of the page reads "ChickenPaint integration example (bumped)"

gastronomical commented 3 years ago

I’m on iOS 14.6 with a 2020 iPad Pro 12.9”. Yeah, still getting the same behaviour even with the bumped version. I have no idea why I can’t see any of the changes…tried on both safari and chromium. Really weird.

thenickdude commented 3 years ago

I found an additional problem with Safari where if it detects the pointer as a "mouse" it doesn't report pressure values either, leading to the invisible ink problem. I swear this was working yesterday, so this might be new in 14.6 / Safari Technology Preview 129.

Please try it again, the header should say "bumped 4" this time.

After using the pen once it should reject palm touches after that, but not before (since ChickenPaint can't tell a pen is being used until it sees it)

gastronomical commented 3 years ago

Everything is working now, thank you! For both chromium and safari. Cheers nick.

thenickdude commented 3 years ago

This should be fixed in the new NPM 0.3.1 release now