import type { IPoint } from "bp/math" ; const TOUCH_SUPPORT = typeof TouchEvent != 'undefined' ; export function $getEventCenter ( event ) { if ( $isTouch ( event ) ) { let t = event . touches ; return { x : ( t [ 1 ] . pageX + t [ 0 ] . pageX ) / 2 , y : ( t [ 1 ] . pageY + t [ 0 ] . pageY ) / 2 } ; } else { return { x : event . pageX , y : event . pageY } ; } } export function $isTouch ( event ) { return TOUCH_SUPPORT && event instanceof TouchEvent ; } export const $LEFT = 0 ; export const $MIDDLE = 1 ; export const $RIGHT = 2 ;