Hello, would appreciate if anyone could translate this from C# to JavaScript please:
if( Event.current.type == EventType.MouseDown && PointIsWithinRect( Event.current.MousePosition, myDraggableObject.rect ) )
{
currentlyDragged = myDraggableObject;
}
else if( Event.current.type == EventType.MouseDrag && currentlyDragged != null )
{
currentlyDragged.rect = new Rect( currentlyDragged.rect.x + Event.current.mousePosition.x, currentlyDragged.rect.y + Event.current.mousePosition.y, currentlyDragged.rect.width, currentlyDragged.rect.height );
}
else if( Event.current.type == EventType.MouseUp )
{
currentlyDragged = null;
}