Fixed bug of guireader

This commit is contained in:
CaiWenzhi 2014-05-08 15:15:09 +08:00
parent 2473422a2f
commit a562f19880
1 changed files with 2 additions and 2 deletions

View File

@ -1113,9 +1113,9 @@ Widget* WidgetPropertiesReader0300::widgetFromJsonDictionary(const rapidjson::Va
{ {
if (child->getPositionType() == cocos2d::ui::POSITION_PERCENT) if (child->getPositionType() == cocos2d::ui::POSITION_PERCENT)
{ {
child->setPositionPercent(Vector2(child->getPositionPercent().x + 0.5f, child->getPositionPercent().y + 0.5f)); child->setPositionPercent(Vector2(child->getPositionPercent().x + widget->getAnchorPoint().x, child->getPositionPercent().y + widget->getAnchorPoint().y));
} }
child->setPosition(Vector2(child->getPositionX() + widget->getSize().width / 2.0f, child->getPositionY() + widget->getSize().height / 2.0f)); child->setPosition(Vector2(child->getPositionX() + widget->getAnchorPointInPoints().x, child->getPositionY() + widget->getAnchorPointInPoints().y));
} }
widget->addChild(child); widget->addChild(child);
} }