@
710 void CCScale9Sprite::setPreferredSize(CCSize preferedSize)
711 {
712 this~~>setContentSize;
713 this~~>m_preferredSize = preferedSize;
714 }
@
As The Code Said : preferred size is the same as the content size.
that means when change preferred size , the content size is changed ![](?
also mean, when change content size , the preferred size is changed )?
but, in below code .
@
721 void CCScale9Sprite::setCapInsets(CCRect capInsets)
722 {
723 CCSize contentSize = this~~>m_obContentSize;
724 this~~>updateWithBatchNode(this~~>scale9Image, this~~>m_spriteRect, m_bSpriteFrameRotated, capInsets);
725 this~~>setContentSize;
726 }
@
when change the cap insets. in the function updateWithBatchNode, content size and preferred size all changed. but last call “this~~>setContentSize(contentSize);” only change content size.
what i suppose to be right is that:
@
721 void CCScale9Sprite::setCapInsets(CCRect capInsets)
722 {
723 CCSize contentSize = this~~>m_obContentSize;
724 this~~>updateWithBatchNode(this~~>scale9Image, this~~>m_spriteRect, m_bSpriteFrameRotated, capInsets);
725 //this~~>setContentSize;
this~~>setPreferredSize(contentSize);
726 }
@