Merge pull request #8960 from kyokomi/feature/CSLoader_setPropsForNodeFromProtocolBuffers

bugfix: setting forget the contentSize.
This commit is contained in:
minggo 2014-10-30 12:43:16 +08:00
commit 2e1e78f95b
1 changed files with 4 additions and 0 deletions

View File

@ -946,6 +946,8 @@ void CSLoader::setPropsForNodeFromProtocolBuffers(cocos2d::Node *node,
int tag = options.tag();
int actionTag = options.actiontag();
bool visible = options.visible();
float w = options.width();
float h = options.height();
node->setName(name);
@ -967,6 +969,8 @@ void CSLoader::setPropsForNodeFromProtocolBuffers(cocos2d::Node *node,
node->setLocalZOrder(zorder);
if(visible != true)
node->setVisible(visible);
if (w != 0 || h != 0)
node->setContentSize(Size(w, h));
node->setTag(tag);
node->setUserObject(ActionTimelineData::create(actionTag));