Minor optimization.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2019-12-17 02:28:00 -03:00
parent 7caa7e8b55
commit 346bda45f2
2 changed files with 9 additions and 2 deletions

View File

@@ -406,6 +406,8 @@ void UIWidget::notifyLayoutAttrChange() {
if ( 0 == mAttributesTransactionCount ) {
NodeMessage msg( this, NodeMessage::LayoutAttributeChange );
messagePost( &msg );
} else {
mFlags |= UI_ATTRIBUTE_CHANGED;
}
}
@@ -756,7 +758,11 @@ void UIWidget::endAttributesTransaction() {
mAttributesTransactionCount--;
if ( 0 == mAttributesTransactionCount ) {
notifyLayoutAttrChange();
if ( mFlags & UI_ATTRIBUTE_CHANGED ) {
notifyLayoutAttrChange();
mFlags &= ~UI_ATTRIBUTE_CHANGED;
}
}
}