Jump to content
Search Community

MSD

Members
  • Posts

    2
  • Joined

  • Last visited

Community Answers

  1. MSD's post in Trigger Draggable by third party device was marked as the answer   
    Ah I found the perfect solution:
     
    On the client side I captured the velocity of x and y and saved this to the db.
    On the serverside I use ThrowPropsPlugin.to() to create the exact same animation.
     
    Hope this helps someone.
     
    ----- EDIT -----
     
    Just some further remarks as I have been fiddling around with this for a couple of more hours:
     
    The solution described above worked as expected with one little issue:
     
    On the client side the square was inside a div which marked the boundary for the Draggable instance.
    As far as I know you can't apply these boundaries to the ThrowPropsPlugin.to() method so you have to do a little math.
     
    Calculate the top and left offset of the boundary div on the serverside Calculate width and height of the boundary div on the serverside Apply these values to the min/max options of x and y values in the ThrowPropsPlugin.to() method on the serverside The velocity calculated on the client side (on DragEnd callback) creates a more "forcefully" animation if directly applied on the serverside. I think it has something to do with the Draggable boundary implementation but I can't find much information  on this. What I did was setting the resistance until it felt right. Cheers,
    Florian.
×
×
  • Create New...