Unnecessary set dirty of ui widget

This commit is contained in:
Haneol Park 2014-11-25 17:50:46 +09:00
parent 59a9d7e4c2
commit d25fdca4af
3 changed files with 6 additions and 2 deletions

View File

@ -112,7 +112,7 @@ void ImageView::initRenderer()
void ImageView::loadTexture(const std::string& fileName, TextureResType texType)
{
if (fileName.empty())
if (fileName.empty() || (_textureFile == fileName && _imageTexType == texType))
{
return;
}

View File

@ -212,7 +212,7 @@ const Rect& LoadingBar::getCapInsets()const
void LoadingBar::setPercent(float percent)
{
if ( percent < 0 || percent > 100)
if ( percent < 0 || percent > 100 || _percent == percent)
{
return;
}

View File

@ -108,6 +108,10 @@ void Text::initRenderer()
void Text::setString(const std::string &text)
{
if (text == _labelRenderer->getString())
{
return;
}
_labelRenderer->setString(text);
updateContentSizeWithTextureSize(_labelRenderer->getContentSize());
_labelRendererAdaptDirty = true;