Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you add GestureDragEndCallback? #4

Open
jifflisLIG opened this issue Jun 17, 2020 · 10 comments
Open

Can you add GestureDragEndCallback? #4

jifflisLIG opened this issue Jun 17, 2020 · 10 comments

Comments

@jifflisLIG
Copy link

No description provided.

@nateshmbhat
Copy link
Owner

nateshmbhat commented Jul 6, 2020

GestureDragEndCallback doesn't contain the location details (x and y positions) which limits me from detecting which shape got this event.

You can still achieve this by using the onTapUp callback and keeping a flag that becomes true once the GestureStart event is fired.

@jackforesightmobile
Copy link

@nateshmbhat I have tried to implement this using the onTapUp callback, but this callback is only fired when I do a quick click on the shape. It isn't fired when I stop dragging the shape.

Do you have any idea why this might be?

Thanks for any help!

@shymek
Copy link

shymek commented Apr 29, 2021

Hi,
I'm also looking for this feature. For me personally, it does not really matter where the "end" event was I just need it recorded.

@shymek
Copy link

shymek commented Apr 30, 2021

@nateshmbhat I have tried to implement this using the onTapUp callback, but this callback is only fired when I do a quick click on the shape. It isn't fired when I stop dragging the shape.

Do you have any idea why this might be?

Thanks for any help!

If you're still fighting with this I just wrapped the CanvasTouchDetector in a Listener widget and I'm listening for onPointerUp event and just passing it on in the meantime. Hope that helps!

@repitch
Copy link

repitch commented Jun 18, 2021

Also request this feature

@AncientPixel
Copy link

Would be great, makes drag & drop behaviour possible.

@EmmanuelMess
Copy link

@nateshmbhat I have tried to implement this using the onTapUp callback, but this callback is only fired when I do a quick click on the shape. It isn't fired when I stop dragging the shape.

Do you have any idea why this might be?

Thanks for any help!

Solved this issue by creating another transparent Rect that acts as a background and setting all other shapes with translucent touch detections. Then when a shape is touched a flag is set so that when the background recieves the touch it acts correctly according to the shape that was touched.

@AncientPixel
Copy link

I still wish there was a onPanEnd callback on shapes.

@ducchungtx
Copy link

I still wish there was a onPanEnd callback on shapes.

me too. I can't control this action. very laggy when try moving the canvas inside.

@autolainen
Copy link

autolainen commented Oct 16, 2023

What if we save a shape when drag starts on it and call onPanEnd on that shape when drag ends? I tried to implement this feature for drawRRect only so far: https://github.com/autolainen/touchable Please have a look and if my approach is acceptable I'll implement this feature for all the draw* methods.

Created a PR: #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants