From 81d0bd8f957430deabb9c55553520144b7c174ba Mon Sep 17 00:00:00 2001
From: knoxHuang <821686174@qq.com>
Date: Tue, 19 Dec 2017 16:22:20 +0800
Subject: [PATCH 1/2] update getWinSizeInPixels API for fireball/issues/6717
---
cocos2d/core/CCDirector.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/cocos2d/core/CCDirector.js b/cocos2d/core/CCDirector.js
index 8429d6be1b..244e118e51 100644
--- a/cocos2d/core/CCDirector.js
+++ b/cocos2d/core/CCDirector.js
@@ -346,7 +346,10 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
* Returns the size of the OpenGL view in pixels.
* It takes into account any possible rotation (device orientation) of the window.
* On Mac winSize and winSizeInPixels return the same value.
- * !#zh 获取视图大小,以像素为单位。
+ * (The pixel here refers to the resource resolution. If you want to get the physics resolution of device, you need to use cc.view.getFrameSize())
+ * !#zh
+ * 获取视图大小,以像素为单位(这里的像素指的是资源分辨率。
+ * 如果要获取屏幕物理分辨率,需要用 cc.view.getFrameSize())
* @method getWinSizeInPixels
* @return {Size}
*/
From f85d440371c55f9665a7a389854c5fc80a47814f Mon Sep 17 00:00:00 2001
From: knoxHuang <821686174@qq.com>
Date: Thu, 21 Dec 2017 10:07:22 +0800
Subject: [PATCH 2/2] add deprecated to getWinSizeInPixels
---
cocos2d/core/CCDirector.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/cocos2d/core/CCDirector.js b/cocos2d/core/CCDirector.js
index 244e118e51..89ae045750 100644
--- a/cocos2d/core/CCDirector.js
+++ b/cocos2d/core/CCDirector.js
@@ -352,6 +352,7 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
* 如果要获取屏幕物理分辨率,需要用 cc.view.getFrameSize())
* @method getWinSizeInPixels
* @return {Size}
+ * @deprecated
*/
getWinSizeInPixels: function () {
return cc.size(this._winSizeInPoints.width * this._contentScaleFactor, this._winSizeInPoints.height * this._contentScaleFactor);