Skip to content

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. #1142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Cocos2d-html5-v2.1.6 @ Sep.19, 2013
9. Fixed a bug of cc.LayerColor that represent incorrect opacity passed into init method
10. Stop listening and remove the event for HtmlImageElement object onload
11. Fixed cc.ProgressTimer display wrong when its sprite was flipped
12. Fixed some bugs for actions that set their object property through reference when initiating actions.

* Known Issues:
1. Effect Advanced Lens3D doesn't work
Expand Down
4 changes: 2 additions & 2 deletions cocos2d/sprite_nodes/CCSprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -2003,11 +2003,11 @@ cc.Sprite = cc.NodeRGBA.extend(/** @lends cc.Sprite# */{
if (this._colorized) {
context.drawImage(image,
0, 0, 0 | locRect.width, 0 | locRect.height,
flipXOffset, flipYOffset, locRect.width, locRect.height);
flipXOffset, flipYOffset, 0 | locRect.width, 0 | locRect.height);
} else {
context.drawImage(image,
0 | locRect.x, 0 | locRect.y, 0 | locRect.width, 0 | locRect.height,
flipXOffset, flipYOffset, locRect.width, locRect.height);
flipXOffset, flipYOffset, 0 | locRect.width, 0 | locRect.height);
}
} else if (locContentSize.width !== 0) {
var curColor = this.getColor();
Expand Down