PC版小游戏适配全屏时,touch坐标获取不正确?
function touchEventHandlerFactory(type) {
return function (event) {
var touchEvent = new TouchEvent(type);
touchEvent.touches = event.touches;
touchEvent.targetTouches = Array.prototype.slice.call(event.touches);
touchEvent.changedTouches = event.changedTouches;
touchEvent.timeStamp = event.timeStamp;
_document2.default.dispatchEvent(touchEvent);
};
}
wx.onTouchStart(touchEventHandlerFactory('touchstart'));
wx.onTouchMove(touchEventHandlerFactory('touchmove'));
wx.onTouchEnd(touchEventHandlerFactory('touchend'));
wx.onTouchCancel(touchEventHandlerFactory('touchcancel'));
pc上启动小游戏,切换为全屏后点击屏幕touches返回的坐标,始终为小屏时的坐标