Skip to content

Commit

Permalink
Element component: mark a batch group as dirty if an attribute has be…
Browse files Browse the repository at this point in the history
…en changed (#4289)

* Element component: mark group dirty if an attribute has been changed

* Review comment: #4289 (comment)

* Review comment: #4289 (comment)

Co-authored-by: kirill.osipov@faraway.gg <Kirill Osipov>
  • Loading branch information
querielo authored May 31, 2022
1 parent 9cdd163 commit f403d7d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/framework/components/element/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -1654,6 +1654,12 @@ class ElementComponent extends Component {

return false;
}

_dirtyBatch() {
if (this.batchGroupId !== -1) {
this.system.app.batcher?.markGroupDirty(this.batchGroupId);
}
}
}

function _define(name) {
Expand All @@ -1668,8 +1674,16 @@ function _define(name) {
},
set: function (value) {
if (this._text) {
if (this._text[name] !== value) {
this._dirtyBatch();
}

this._text[name] = value;
} else if (this._image) {
if (this._image[name] !== value) {
this._dirtyBatch();
}

this._image[name] = value;
}
}
Expand Down

0 comments on commit f403d7d

Please sign in to comment.