Hello James,

Thx for reviewing. Be careful: there are 2 functions initWithFile, one
takes a file and a rect, the other takes a rect and a file. The second uses
the rect as capInsets, not as frame rect. In the create function I
corrected, the rect given is not a frame rect, but a cap insets rect. If
you call initWithFile(const char*, CCRect), the rect will however be used
as a frame rect. The correct function is initWithFile(CCRect, const char*).

Kind Regards,

Marcel Bloemendaal.



2013/1/21 James Chen <notifications@github.com>

> In extensions/GUI/CCControlExtension/CCScale9Sprite.cpp:
>
> > @@ -468,7 +468,7 @@ bool CCScale9Sprite::initWithFile(CCRect capInsets, const char* file)
> >  CCScale9Sprite* CCScale9Sprite::create(CCRect capInsets, const char* file)
> >  {
> >      CCScale9Sprite* pReturn = new CCScale9Sprite();
> > -    if ( pReturn && pReturn->initWithFile(file, capInsets) )
> > +    if ( pReturn && pReturn->initWithFile(capInsets, file) )
>
> CCScale9Sprite::initWithFile(const char* file, CCRect rect);
> The first parameter is file name, and the second parameter is rectangle.
> Why should make this reversal?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/cocos2d/cocos2d-x/pull/1874/files#r2712763>.
>
>