@@ -433,12 +433,6 @@ ccui.Scale9Sprite = cc.Scale9Sprite = cc.Node.extend(/** @lends ccui.Scale9Sprit
433
433
this . _updateCapInsets ( this . _spriteFrame . _rect , this . _capInsetsInternal ) ;
434
434
} ,
435
435
436
- setPreferredSize : function ( preferredSize ) {
437
- if ( ! preferredSize || cc . sizeEqualToSize ( this . _contentSize , preferredSize ) ) return ;
438
-
439
- this . setContentSize ( preferredSize ) ;
440
- } ,
441
-
442
436
_updateCapInsets : function ( rect , capInsets ) {
443
437
if ( ! capInsets || ! rect || cc . _rectEqualToZero ( capInsets ) ) {
444
438
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
650
644
return new cc . BlendFunc ( this . _blendFunc . src , this . _blendFunc . dst ) ;
651
645
} ,
652
646
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
+
653
656
// overrides
654
657
setContentSize : function ( width , height ) {
655
658
if ( height === undefined ) {
@@ -664,7 +667,7 @@ ccui.Scale9Sprite = cc.Scale9Sprite = cc.Node.extend(/** @lends ccui.Scale9Sprit
664
667
this . _quadsDirty = true ;
665
668
} ,
666
669
667
- getContentSize : function ( ) {
670
+ getContentSize : function ( ) {
668
671
if ( this . _renderingType === ccui . Scale9Sprite . RenderingType . SIMPLE ) {
669
672
if ( this . _spriteFrame ) {
670
673
return this . _spriteFrame . _originalSize ;
0 commit comments