Skip to content

Commit ce1195d

Browse files
committed
Issue #2803: fixed a bug for cc.Sprite that its drawing doesn't work when _rect's width or height greater than 0 and less than 1.
1 parent 1e3b427 commit ce1195d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cocos2d/sprite_nodes/CCSprite.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2003,11 +2003,11 @@ cc.Sprite = cc.NodeRGBA.extend(/** @lends cc.Sprite# */{
20032003
if (this._colorized) {
20042004
context.drawImage(image,
20052005
0, 0, 0 | locRect.width, 0 | locRect.height,
2006-
flipXOffset, flipYOffset, locRect.width, locRect.height);
2006+
flipXOffset, flipYOffset, 0 | locRect.width, 0 | locRect.height);
20072007
} else {
20082008
context.drawImage(image,
20092009
0 | locRect.x, 0 | locRect.y, 0 | locRect.width, 0 | locRect.height,
2010-
flipXOffset, flipYOffset, locRect.width, locRect.height);
2010+
flipXOffset, flipYOffset, 0 | locRect.width, 0 | locRect.height);
20112011
}
20122012
} else if (locContentSize.width !== 0) {
20132013
var curColor = this.getColor();

0 commit comments

Comments
 (0)