@@ -433,12 +433,6 @@ ccui.Scale9Sprite = cc.Scale9Sprite = cc.Node.extend(/** @lends ccui.Scale9Sprit
433433 this . _updateCapInsets ( this . _spriteFrame . _rect , this . _capInsetsInternal ) ;
434434 } ,
435435
436- setPreferredSize : function ( preferredSize ) {
437- if ( ! preferredSize || cc . sizeEqualToSize ( this . _contentSize , preferredSize ) ) return ;
438-
439- this . setContentSize ( preferredSize ) ;
440- } ,
441-
442436 _updateCapInsets : function ( rect , capInsets ) {
443437 if ( ! capInsets || ! rect || cc . _rectEqualToZero ( capInsets ) ) {
444438 rect = rect || { x :0 , y :0 , width : this . _contentSize . width , height : this . _contentSize . height } ;
@@ -650,6 +644,15 @@ ccui.Scale9Sprite = cc.Scale9Sprite = cc.Node.extend(/** @lends ccui.Scale9Sprit
650644 return new cc . BlendFunc ( this . _blendFunc . src , this . _blendFunc . dst ) ;
651645 } ,
652646
647+ setPreferredSize : function ( preferredSize ) {
648+ if ( ! preferredSize || cc . sizeEqualToSize ( this . _contentSize , preferredSize ) ) return ;
649+ this . setContentSize ( preferredSize ) ;
650+ } ,
651+
652+ getPreferredSize : function ( ) {
653+ return this . getContentSize ( ) ;
654+ } ,
655+
653656 // overrides
654657 setContentSize : function ( width , height ) {
655658 if ( height === undefined ) {
@@ -664,7 +667,7 @@ ccui.Scale9Sprite = cc.Scale9Sprite = cc.Node.extend(/** @lends ccui.Scale9Sprit
664667 this . _quadsDirty = true ;
665668 } ,
666669
667- getContentSize : function ( ) {
670+ getContentSize : function ( ) {
668671 if ( this . _renderingType === ccui . Scale9Sprite . RenderingType . SIMPLE ) {
669672 if ( this . _spriteFrame ) {
670673 return this . _spriteFrame . _originalSize ;
0 commit comments