-
Notifications
You must be signed in to change notification settings - Fork 320
fix: iOS touch in segmentation brush mode #802
base: master
Are you sure you want to change the base?
fix: iOS touch in segmentation brush mode #802
Conversation
- added e.preventDefault on touch canvas - added fallback to e.layerX, e.layerY when e.offsetX, e.offsetY missing
Thank you for your amazing contribution! |
@hogepodge please take a look at this PR |
/git merge master
|
/git merge master
|
sadly,when the image become large,like 1M+, the touch draw region saved nothing after submit or update |
This PR attempts to fix the touch input issues on label studio when using iPad Apple Pencil and brush / segmentation mode.
It isn't 100% perfect but
ImageView.js
is complex and I don't pretend to know all the edge cases.There are some videos here showing the issue and it working afterwards.
https://imgur.com/a/fY4LsSf
It seems like @lavrton suggestion of mapping the events directly isnt enough: konvajs/konva#1361 (comment)
From what I can tell, the
MouseEvent
's have.offsetX
and.offsetY
however theTouchEvent
's don't have these, but do have some similar values such as.layerX
and.layerY
. 🤷♀️.Additionally, there is the need to pinch and zoom, but without
e.preventDefault()
doing things is particularly challenging.My guess is that something like this would be optimal in the long term:
https://github.com/shuding/apple-pencil-safari-api-test
I know theres a lot of people using computers to label, but honestly, for brush style annotations, surely
iPad
support should be a #1 priority.I am happy to help get this ready for merge if someone can help me understand what would be next to do.