浏览代码

Mark the modifications.

/main
Yuncong Zhang 6 年前
当前提交
03d8a019
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8
      Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio.jslib

8
Runtime/Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio.jslib


h = Math.round(w / Module["forcedAspectRatio"]);
}
}
//////////// Modification Start ////////////////////
var dpr = window.devicePixelRatio;
if ((document["fullscreenElement"] || document["mozFullScreenElement"] || document["msFullscreenElement"] || document["webkitFullscreenElement"] || document["webkitCurrentFullScreenElement"]) === canvas.parentNode && typeof screen != "undefined") {
var factor = Math.min((screen.width * dpr) / w, (screen.height * dpr) / h);

if (!canvas.style.getPropertyValue("height").includes("%")) canvas.style.setProperty("height", (h / dpr) + "px", "important");
}
}
///////////////// Modification End ///////////////////
}),
wgetRequests: {},
nextWgetRequestHandle: 0,

};
}),
fillMouseEventData: (function (eventStruct, e, target) {
///////////////// Modification Start ///////////////////////
var devicePixelRatio = window.devicePixelRatio;
HEAPF64[eventStruct >> 3] = JSEvents.tick();
HEAP32[eventStruct + 8 >> 2] = e.screenX * devicePixelRatio;

JSEvents.previousScreenX = e.screenX * devicePixelRatio;
JSEvents.previousScreenY = e.screenY * devicePixelRatio;
}
////////////// Modification End //////////////////////////////
}),
registerMouseEventCallback: (function(target, userData, useCapture, callbackfunc, eventTypeId, eventTypeString) {
if (!JSEvents.mouseEvent) {

stringToUTF8(id, eventStruct + 136, 128);
HEAP32[eventStruct + 264 >> 2] = reportedElement ? reportedElement.clientWidth : 0;
HEAP32[eventStruct + 268 >> 2] = reportedElement ? reportedElement.clientHeight : 0;
//////////////////// Modification Start ///////////////////////////////
//////////////////// Modification End ///////////////////////////////
if (isFullscreen) {
JSEvents.previousFullscreenElement = fullscreenElement;
}

var canvasRect = Module["canvas"] ? Module["canvas"].getBoundingClientRect() : undefined;
var targetRect = JSEvents.getBoundingClientRectOrZeros(target);
var numTouches = 0;
//////////////////// Modification Start ////////////////////////////
var devicePixelRatio = window.devicePixelRatio;
for (var i in touches) {
var t = touches[i];

}
HEAP32[ptr + 36 >> 2] = (t.clientX - targetRect.left) * devicePixelRatio;
HEAP32[ptr + 40 >> 2] = (t.clientY - targetRect.top) * devicePixelRatio;
//////////////////// Modification End ////////////////////////////
ptr += 52;
if (++numTouches >= 32) {
break;

正在加载...
取消
保存