Merge pull request #2370 from dumganhar/iss2054-s9sp-anchorpoint-ccb

Fixed #2054: AnchorPoint property of CCScale9Sprite doesn't work in CCBReader.
This commit is contained in:
James Chen 2013-04-14 20:54:02 -07:00
commit d89b5cbcb2
3 changed files with 6 additions and 3 deletions

View File

@ -312,6 +312,9 @@ Developers:
Fixing a linking error that libpthread and libGL libraries need to be linked on linux.
Fixing a compiling error of [-Werror=array-bounds] when compiling Box2dTestBed.
zhanghaojie
Fixing a bug that anchorPoint property of CCScale9Sprite doesn't work in CCBReader.
Retired Core Developers:
WenSheng Yang
Author of windows port, CCTextField,

View File

@ -17,7 +17,7 @@ NS_CC_EXT_BEGIN
void CCScale9SpriteLoader::onHandlePropTypeSpriteFrame(CCNode * pNode, CCNode * pParent, const char * pPropertyName, CCSpriteFrame * pCCSpriteFrame, CCBReader * pCCBReader) {
if(strcmp(pPropertyName, PROPERTY_SPRITEFRAME) == 0) {
((CCScale9Sprite *)pNode)->initWithSpriteFrame(pCCSpriteFrame);
((CCScale9Sprite *)pNode)->setSpriteFrame(pCCSpriteFrame);
} else {
CCNodeLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pCCSpriteFrame, pCCBReader);
}

View File

@ -638,7 +638,7 @@ CCScale9Sprite* CCScale9Sprite::resizableSpriteWithCapInsets(CCRect capInsets)
CCScale9Sprite* CCScale9Sprite::create()
{
CCScale9Sprite *pReturn = new CCScale9Sprite();
if (pReturn)
if (pReturn && pReturn->init())
{
pReturn->autorelease();
return pReturn;