function globalToLocal(x, y, v) {
	v = v || vector2dPool.get();
	const rect = device.getElementBounds(renderer.getCanvas());
	const pixelRatio = globalThis.devicePixelRatio || 1;
	x -= rect.left + (globalThis.pageXOffset || 0);
	y -= rect.top + (globalThis.pageYOffset || 0);
	const scale = renderer.scaleRatio;
	if (scale.x !== 1.0 || scale.y !== 1.0) {
		x /= scale.x;
		y /= scale.y;
	}
	return v.set(x * pixelRatio, y * pixelRatio);
}
Translate the specified x and y values from the global (absolute)
coordinate to local (viewport) relative coordinate.
@memberof input
@param {number} x - the global x coordinate to be translated.
@param {number} y - the global y coordinate to be translated.
@param {Vector2d} [v] - an optional vector object where to set the translated coordinates
@returns {Vector2d} A vector object with the corresponding translated coordinates
@example
onMouseEvent : function (pointer) {
   // convert the given into local (viewport) relative coordinates
   let pos = me.input.globalToLocal(pointer.clientX, pointer.clientY);
   // do something with pos !
};