fix CCScale9Sprite CapInsets bug for rotated sprite frame

This commit is contained in:
pktangyue 2013-07-08 17:00:27 +08:00
parent d0b7b403b9
commit 3e5c62f905
1 changed files with 4 additions and 14 deletions

View File

@ -687,20 +687,10 @@ void Scale9Sprite::updateCapInset()
}
else
{
if (_spriteFrameRotated)
{
insets = CCRectMake(_insetBottom,
_insetLeft,
_spriteRect.size.width-_insetRight-_insetLeft,
_spriteRect.size.height-_insetTop-_insetBottom);
}
else
{
insets = CCRectMake(_insetLeft,
_insetTop,
_spriteRect.size.width-_insetLeft-_insetRight,
_spriteRect.size.height-_insetTop-_insetBottom);
}
insets = CCRectMake(_insetLeft,
_insetTop,
_spriteRect.size.width-_insetLeft-_insetRight,
_spriteRect.size.height-_insetTop-_insetBottom);
}
this->setCapInsets(insets);
}