From ebffc66a834a6412d8d36212a2c6ad09eba0e23f Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 12 May 2014 18:07:13 +0800 Subject: [PATCH] closed #5118, fix CCSGUIReader setAnchorPoint --- cocos/editor-support/cocostudio/CCSGUIReader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index a3b067a759..4265033bb1 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -1265,7 +1265,10 @@ void WidgetPropertiesReader0300::setColorPropsForWidgetFromJsonDictionary(Widget apyf = widget->getAnchorPoint().y; } - widget->setAnchorPoint(Vector2(apxf, apyf)); + if (apx || apy) { + widget->setAnchorPoint(Vector2(apxf, apyf)); + } + bool flipX = DICTOOL->getBooleanValue_json(options, "flipX"); bool flipY = DICTOOL->getBooleanValue_json(options, "flipY"); widget->setFlippedX(flipX);