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

@ -686,22 +686,12 @@ void Scale9Sprite::updateCapInset()
insets = RectZero;
}
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);
}
}
this->setCapInsets(insets);
}