export function getCursorPosition ( event ) { let touches = event . touches ; let source = event ; if ( event . touches === undefined && event . originalEvent !== undefined ) { touches = event . originalEvent . touches ; } if ( touches !== undefined && touches . length > 0 ) { source = touches [ 0 ] ; } return { x : source . clientX || 0 , y : source . clientY || 0 } ; }