mirror of https://github.com/axmolengine/axmol.git
Merge pull request #14055 from Dimon4eg/fix-crash-in-LoadingBar
fix crash in LoadingBar
This commit is contained in:
commit
e32e8b95a4
|
@ -282,11 +282,14 @@ void LoadingBar::updateProgressBar()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float res = _percent / 100.0f;
|
Sprite* innerSprite = _barRenderer->getSprite();
|
||||||
Sprite* spriteRenderer = _barRenderer->getSprite();
|
if (nullptr != innerSprite)
|
||||||
Rect rect = spriteRenderer->getTextureRect();
|
{
|
||||||
rect.size.width = _barRendererTextureSize.width * res;
|
float res = _percent / 100.0f;
|
||||||
spriteRenderer->setTextureRect(rect, spriteRenderer->isTextureRectRotated(), rect.size);
|
Rect rect = innerSprite->getTextureRect();
|
||||||
|
rect.size.width = _barRendererTextureSize.width * res;
|
||||||
|
innerSprite->setTextureRect(rect, innerSprite->isTextureRectRotated(), rect.size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue