{"action":"created","issue":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14596","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14596/labels{/name}","comments_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14596/comments","events_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14596/events","html_url":"https://github.com/cocos2d/cocos2d-x/issues/14596","id":120554601,"number":14596,"title":"Button widget with 9-slice enabled cloning problem","user":{"login":"vasyaPP","id":2494560,"avatar_url":"https://avatars.githubusercontent.com/u/2494560?v=3","gravatar_id":"","url":"https://api.github.com/users/vasyaPP","html_url":"https://github.com/vasyaPP","followers_url":"https://api.github.com/users/vasyaPP/followers","following_url":"https://api.github.com/users/vasyaPP/following{/other_user}","gists_url":"https://api.github.com/users/vasyaPP/gists{/gist_id}","starred_url":"https://api.github.com/users/vasyaPP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasyaPP/subscriptions","organizations_url":"https://api.github.com/users/vasyaPP/orgs","repos_url":"https://api.github.com/users/vasyaPP/repos","events_url":"https://api.github.com/users/vasyaPP/events{/privacy}","received_events_url":"https://api.github.com/users/vasyaPP/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/labels/module:ui","name":"module:ui","color":"207de5"},{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/labels/type:bug","name":"type:bug","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-05T13:35:28Z","updated_at":"2015-12-08T10:03:34Z","closed_at":null,"body":"I have just upgraded my project from cocos2d-x v3.7 up to v3.9 release and discovered problem with Button widget. I have button with 9-slice enabled created with cocostudio. And after cloning button it displayed with wrong size - width and height of button are equal to texture size, not the original button size.\r\n\r\nWithout these lines of code everything working perfect:\r\n\r\n    UIButton.cpp\r\n    void Button::setupNormalTexture() {\r\n        ...\r\n        // force update _customSize, fixed issue:\r\n        // https://github.com/cocos2d/cocos2d-x/issues/12249\r\n        _customSize = _normalTextureSize;\r\n        ... \r\n    }\r\n\r\nIt can be reproduced with cocos2d-x v3.9, cocostudio 2.3.3 (mac os). If it's important texture was packed in atlas with TexturePacker.\r\n\r\n    auto rootNode = cocos2d::CSLoader::createNode(\"Layers/UILayer.csb\");\r\n    addChild(rootNode);\r\n    \r\n    auto btn = rootNode->getChildByName<cocos2d::ui::Button*>(\"btn\");\r\n    auto btn2 = btn->clone();\r\n    addChild(btn2);\r\n    btn2->setPositionY(btn->getPositionY() + 100);\r\n\r\n<img width=\"228\" alt=\"screen shot 2015-12-05 at 16 17 26\" src=\"https://cloud.githubusercontent.com/assets/2494560/11607986/e71566d4-9b6d-11e5-90c3-20899730da07.png\">"},"comment":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/comments/162837635","html_url":"https://github.com/cocos2d/cocos2d-x/issues/14596#issuecomment-162837635","issue_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14596","id":162837635,"user":{"login":"zilongshanren","id":785541,"avatar_url":"https://avatars.githubusercontent.com/u/785541?v=3","gravatar_id":"","url":"https://api.github.com/users/zilongshanren","html_url":"https://github.com/zilongshanren","followers_url":"https://api.github.com/users/zilongshanren/followers","following_url":"https://api.github.com/users/zilongshanren/following{/other_user}","gists_url":"https://api.github.com/users/zilongshanren/gists{/gist_id}","starred_url":"https://api.github.com/users/zilongshanren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zilongshanren/subscriptions","organizations_url":"https://api.github.com/users/zilongshanren/orgs","repos_url":"https://api.github.com/users/zilongshanren/repos","events_url":"https://api.github.com/users/zilongshanren/events{/privacy}","received_events_url":"https://api.github.com/users/zilongshanren/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T10:03:34Z","updated_at":"2015-12-08T10:03:34Z","body":"@vasyaPP \r\nplease check the latest v3 branch."}}