Closed iandanforth closed 8 years ago
For performance reasons hit graph for a layer will be disabled while drag&drop. I suggest to move dragging shape into another layer. https://jsfiddle.net/eL6vcm5f/2/
Thank you for the quick response and fiddle! This is very helpful.
It might also be useful to add a note about this optimization into one of the drag and drop example sections. For reference I was using http://konvajs.github.io/docs/drag_and_drop/Complex_Drag_and_Drop.html and http://konvajs.github.io/docs/sandbox/Physics_Simulator.html during my exploration.
I'm trying to prevent a circle from being dragged over rectangles. I have a layer named dynamicLayer which contains both a circle and a rectangle. I had thought to implement a collision check in dragBoundFunc, however after the circle has been dragged more than 2 pixels, all I get back is 'null'.
Digging into this a bit https://github.com/konvajs/konva/blob/master/src/Layer.js#L140 starts returning all zero's after the 2nd or third call, but only in the context of dragBoundFunc.
Fiddle: https://jsfiddle.net/eL6vcm5f/1/ (see console output)