Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by lake

  1. I got it. Yes it turns out the pointer is out of sync because I was hit testing the wrapper div element attached to the directive. I was able to fix that by hit testing the inner div the image is attached to instead. 



    The behavior with the drag item accelerating across the screen only happens in my app (not in the codepen) in iOS/android and desktop Chrome/Safari..  I will have to do some digging there. Thank you for the tip about using the transform object's X,Y. 

  2. Oops! I spoke too soon. If you look at the codepn you will see the problem.

    See the Pen OVeaMw by leyk (@leyk) on CodePen

    Try dragging the black square left to right across the bottom set of drop areas.

    You will see the drop zone area labeled "black" will be shaded green indicating the hit test returned "true". It returns true even before the overlap occurs, which incorrect. I log the Draggable.x,y and pointerX,Y and there is about a 100px difference. 


    Here is what I see in the console log:

    draggable.x and draggable.y: 760 266 draggable.pinterX,draggable.pinterY: 654 337.


    What I sometimes see in my app (on the device\browser) is the draggable item accelerating across the screen faster than the user intended. It appears as if  draggable item trying to sync with the pointer position.    


    I appreciate your help.


  3. Sometimes when I drag the draggable item really fast across the screen. The position of the element becomes misaligned and is no longer aligned with the position of the pointer where my finger is. I'm not sure where to begin. I'm hoping someone has come across this issue at some point? I was not able to find anything in the forum. 

    I'm trying to use it in an Angular directive within an ionic framework\Cordova app I'm not doing anything fancy— I'm doing the following:

    1.  on drag: Checking for hit test to determine where I'm hovering
    2.  on drop: I'm Setting the bounds to elements the user can drop on
    3.  If user tries to drop on on-droppable elements, tween back to the original position

    Everything works perfectly except for the occasional spurt where the element position does not line-up with the pointer\finger\user's drag position.  

    Any help is appreciated.