{"action":"created","issue":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14522","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14522/labels{/name}","comments_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14522/comments","events_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14522/events","html_url":"https://github.com/cocos2d/cocos2d-x/issues/14522","id":119440796,"number":14522,"title":"ClippingNode inside a ScrollView does not work properly...","user":{"login":"willmoon","id":5382987,"avatar_url":"https://avatars.githubusercontent.com/u/5382987?v=3","gravatar_id":"","url":"https://api.github.com/users/willmoon","html_url":"https://github.com/willmoon","followers_url":"https://api.github.com/users/willmoon/followers","following_url":"https://api.github.com/users/willmoon/following{/other_user}","gists_url":"https://api.github.com/users/willmoon/gists{/gist_id}","starred_url":"https://api.github.com/users/willmoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willmoon/subscriptions","organizations_url":"https://api.github.com/users/willmoon/orgs","repos_url":"https://api.github.com/users/willmoon/repos","events_url":"https://api.github.com/users/willmoon/events{/privacy}","received_events_url":"https://api.github.com/users/willmoon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-30T08:21:56Z","updated_at":"2015-12-01T05:17:23Z","closed_at":null,"body":"I have some ClippingNodes in TableView which inherit from Scrollview...But the ClippingNode does not work properly...When first created,it show the ClippingNode,after that it is at a random state "},"comment":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/comments/160856556","html_url":"https://github.com/cocos2d/cocos2d-x/issues/14522#issuecomment-160856556","issue_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14522","id":160856556,"user":{"login":"willmoon","id":5382987,"avatar_url":"https://avatars.githubusercontent.com/u/5382987?v=3","gravatar_id":"","url":"https://api.github.com/users/willmoon","html_url":"https://github.com/willmoon","followers_url":"https://api.github.com/users/willmoon/followers","following_url":"https://api.github.com/users/willmoon/following{/other_user}","gists_url":"https://api.github.com/users/willmoon/gists{/gist_id}","starred_url":"https://api.github.com/users/willmoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willmoon/subscriptions","organizations_url":"https://api.github.com/users/willmoon/orgs","repos_url":"https://api.github.com/users/willmoon/repos","events_url":"https://api.github.com/users/willmoon/events{/privacy}","received_events_url":"https://api.github.com/users/willmoon/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T05:17:23Z","updated_at":"2015-12-01T05:17:23Z","body":"Ok,I have an ImageView which will be clipped,and the ImageView is in a json file made by the CocoStutio.I put the ImageView into a tableviewcell  and get it cliiped.Here is some code: \r\n\r\nif ( !pImageView )\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\tm_StencilPosition = stencilPosition;\r\n\tif ( !_imageRenderer )\r\n\t{\r\n\t\tClippingNode* clipNode = ClippingNode::create();\r\n\t\tm_pStencil = Sprite::create(path);\r\n\t\tm_pStencil->setPosition(stencilPosition);\r\n\t\tif (newSize > 0)\r\n\t\t{\r\n\t\t\tfloat fStencilScale = newSize / m_pStencil->getContentSize().width;\r\n\t\t\tm_pStencil->setScale(fStencilScale);\r\n\t\t}\r\n\t\tclipNode->setStencil(m_pStencil);\r\n\t\t//设置要计算裁减alpha值\r\n\t\tclipNode->setAlphaThreshold(0.05f);\r\n\t\tclipNode->setAnchorPoint(Point(0.5,0.5));\r\n\r\n\t\tm_pClipNode = clipNode;\r\n\t\t\r\n\t\tthis->copyProperties(pImageView);\r\n\t\tm_pContent = pImageView->getVirtualRenderer();\r\n\t\tif ( m_pContent == nullptr )\r\n\t\t{\r\n\t\t\tm_pContent = Scale9Sprite::create();\r\n\t\t}\r\n\t\tif ( m_pContent )\r\n\t\t{\r\n\t\tif ( m_pContent->getParent() != nullptr )\r\n\t\t\t\t{\r\n\t\t\t\t\tpImageView->removeProtectedChild(m_pContent);\r\n\t\t\t\t}\r\n\t\t\t\tm_pClipNode->addChild(m_pContent);\r\n\t\t\t\taddProtectedChild(m_pClipNode, IMAGE_RENDERER_Z, -1);\r\n\t\t\t\tm_pClipNode->setPosition( pImageView->getPosition().x,pImageView->getPosition().y );\r\n\r\n\t\t\t\tNode* pParent = pImageView->getParent();\r\n\t\t\t\tpParent->addChild(this);\r\n\t\t\t\tpImageView->removeFromParent();\r\n\t\t\t}\r\n\t\t\r\n\t}"}}