Skip to content

Commit 64117c1

Browse files
committed
Fix setRealPixelResolution not working on some devices
1 parent 8737f56 commit 64117c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cocos2d/core/platform/CCEGLView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
694694
*/
695695
setRealPixelResolution: function (width, height, resolutionPolicy) {
696696
// Set viewport's width
697-
this._setViewportMeta({"width": width, "user-scalable": "no"}, true);
697+
this._setViewportMeta({"width": width, "target-densitydpi": cc.DENSITYDPI_DEVICE, "user-scalable": "no"}, true);
698698

699699
// Set body width to the exact pixel resolution
700700
document.body.style.width = width + "px";

0 commit comments

Comments
 (0)