From f66705b0d44e45a809cd65ee24dcd7c0728b1576 Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Wed, 25 May 2016 10:27:38 +0800 Subject: [PATCH] convertToWorldSpace should not support omitted argument --- cocos2d/core/base-nodes/CCSGNode.js | 2 -- cocos2d/core/utils/base-node.js | 8 -------- 2 files changed, 10 deletions(-) diff --git a/cocos2d/core/base-nodes/CCSGNode.js b/cocos2d/core/base-nodes/CCSGNode.js index 176236110a..f508e3ec1f 100644 --- a/cocos2d/core/base-nodes/CCSGNode.js +++ b/cocos2d/core/base-nodes/CCSGNode.js @@ -1831,7 +1831,6 @@ _ccsg.Node = cc.Class({ * @return {cc.Vec2} */ convertToWorldSpace: function (nodePoint) { - nodePoint = nodePoint || cc.p(0,0); return cc.pointApplyAffineTransform(nodePoint, this.getNodeToWorldTransform()); }, @@ -1854,7 +1853,6 @@ _ccsg.Node = cc.Class({ * @return {cc.Vec2} */ convertToWorldSpaceAR: function (nodePoint) { - nodePoint = nodePoint || cc.p(0,0); var pt = cc.pAdd(nodePoint, this._renderCmd.getAnchorPointInPoints()); return this.convertToWorldSpace(pt); }, diff --git a/cocos2d/core/utils/base-node.js b/cocos2d/core/utils/base-node.js index ff24e23ff6..defe17b533 100644 --- a/cocos2d/core/utils/base-node.js +++ b/cocos2d/core/utils/base-node.js @@ -1501,10 +1501,6 @@ var BaseNode = cc.Class(/** @lends cc.Node# */{ // ensure transform computed cc.director._visitScene(); } - if (CC_JSB) { - // should also support omit argument in JSB - nodePoint = nodePoint || new cc.Vec2(0, 0); - } var worldPositionIgnoreAnchorPoint = this._sgNode.convertToWorldSpace(nodePoint); return cc.pSub(worldPositionIgnoreAnchorPoint, cc.p(this._anchorPoint.x * this._contentSize.width, this._anchorPoint.y * this._contentSize.height)); }, @@ -1556,10 +1552,6 @@ var BaseNode = cc.Class(/** @lends cc.Node# */{ } if (this._sgNode.isIgnoreAnchorPointForPosition()) { // see https://github.com/cocos-creator/engine/pull/391 - if (CC_JSB) { - // should also support omit argument in JSB - nodePoint = nodePoint || new cc.Vec2(0, 0); - } return cc.v2(this._sgNode.convertToWorldSpace(nodePoint)); } else {