-
Notifications
You must be signed in to change notification settings - Fork 753
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
stage.getIntersection returns null when called from dragmove handler #601
Comments
👍 Really need to such stuff as detect drop shape. I think best realisation is events "dragover", "dragout". |
Let me clarify a bit on what's happening. Currently, when you drag and drop a shape, the hit graph is not redrawn on each animation frame to help improve drag performance. As a result, shapes are temporarily undetectable. What you really need is true collision detection + dragover / dragout. I have plans to support these, but haven't gotten around to it yet. |
Thanks Eric - I suspected it might be a performance optimization. Adding collision detection with "dragover" and "dragout" would be really useful! For now, I'm getting the mouse position on each "dragmove" event and looping through the drop targets to find any overlap (I suspect this is pretty inefficient, but it seems to work ok in my small project :) |
You can move draggable shape to temporary layer on dragstart, then call |
The tempCanvas method doesn't seem to work anymore, at least not using that jsbin code. The stopDrag and startDrag methods seem to make the dragstart (and dragend) event behave like dragmove, ie it fires all the time during the drag, which messes things up. And I didn't get it to work without those drag methods. Is there a way to turn on the hitgraph during dragging? |
I think we should implement easy way to change layer while dragging and add |
Thanks @lavrton for the workaround. Saved me a lot of frustration :-) |
Hi,
I'm trying to highlight drop targets as a shape is dragged over them. However, the getIntersection function seems to return null when called during a drag (even with hard coded coordinates). Is this a bug, or is there a better way to determine when a dragged shape is over one of the allowed drop shapes?
Thanks,
Dan
The text was updated successfully, but these errors were encountered: