Skip to content

Commit 9e672fb

Browse files
committed
Merge pull request cocos2d#1080 from 06wj/develop
update cc.RectApplyAffineTransform
2 parents 1ef99e6 + 51093cd commit 9e672fb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cocos2d/base_nodes/CCNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,7 @@ cc.NodeCanvas = cc.Class.extend(/** @lends cc.NodeCanvas# */{
23182318
*/
23192319
setScale:function (scale, scaleY) {
23202320
this._scaleX = scale;
2321-
this._scaleY = scaleY || scale;
2321+
this._scaleY = scaleY === undefined ? scale : scaleY;
23222322
this.setNodeDirty();
23232323
},
23242324

cocos2d/cocoa/CCAffineTransform.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ cc.RectApplyAffineTransform = function (rect, anAffineTransform) {
127127
var bottomLeft = cc.PointApplyAffineTransform(cc.p(left, bottom), anAffineTransform);
128128
var bottomRight = cc.PointApplyAffineTransform(cc.p(right, bottom), anAffineTransform);
129129

130-
var minX = Math.min(Math.min(topLeft.x, topRight.x), Math.min(bottomLeft.x, bottomRight.x));
131-
var maxX = Math.max(Math.max(topLeft.x, topRight.x), Math.max(bottomLeft.x, bottomRight.x));
132-
var minY = Math.min(Math.min(topLeft.y, topRight.y), Math.min(bottomLeft.y, bottomRight.y));
133-
var maxY = Math.max(Math.max(topLeft.y, topRight.y), Math.max(bottomLeft.y, bottomRight.y));
130+
var minX = Math.min(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x);
131+
var maxX = Math.max(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x);
132+
var minY = Math.min(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y);
133+
var maxY = Math.max(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y);
134134

135135
return cc.rect(minX, minY, (maxX - minX), (maxY - minY));
136136
};

0 commit comments

Comments
 (0)