mirror of https://github.com/axmolengine/axmol.git
Unnecessary set dirty of ui widget
This commit is contained in:
parent
59a9d7e4c2
commit
d25fdca4af
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue