diff --git a/cocos2d/base_nodes/CCNode.js b/cocos2d/base_nodes/CCNode.js index f57ebb7ca6..ea08902136 100644 --- a/cocos2d/base_nodes/CCNode.js +++ b/cocos2d/base_nodes/CCNode.js @@ -2318,7 +2318,7 @@ cc.NodeCanvas = cc.Class.extend(/** @lends cc.NodeCanvas# */{ */ setScale:function (scale, scaleY) { this._scaleX = scale; - this._scaleY = scaleY || scale; + this._scaleY = scaleY === undefined ? scale : scaleY; this.setNodeDirty(); }, diff --git a/cocos2d/cocoa/CCAffineTransform.js b/cocos2d/cocoa/CCAffineTransform.js index e5642b93c7..fbf7f30a9d 100644 --- a/cocos2d/cocoa/CCAffineTransform.js +++ b/cocos2d/cocoa/CCAffineTransform.js @@ -127,10 +127,10 @@ cc.RectApplyAffineTransform = function (rect, anAffineTransform) { var bottomLeft = cc.PointApplyAffineTransform(cc.p(left, bottom), anAffineTransform); var bottomRight = cc.PointApplyAffineTransform(cc.p(right, bottom), anAffineTransform); - var minX = Math.min(Math.min(topLeft.x, topRight.x), Math.min(bottomLeft.x, bottomRight.x)); - var maxX = Math.max(Math.max(topLeft.x, topRight.x), Math.max(bottomLeft.x, bottomRight.x)); - var minY = Math.min(Math.min(topLeft.y, topRight.y), Math.min(bottomLeft.y, bottomRight.y)); - var maxY = Math.max(Math.max(topLeft.y, topRight.y), Math.max(bottomLeft.y, bottomRight.y)); + var minX = Math.min(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x); + var maxX = Math.max(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x); + var minY = Math.min(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y); + var maxY = Math.max(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y); return cc.rect(minX, minY, (maxX - minX), (maxY - minY)); };