Merge pull request #72225 from MinusKube/shaped_text_invalidated_bug

Mark dirty flags when shaped texts are invalidated
This commit is contained in:
Rémi Verschelde 2023-02-13 09:13:27 +01:00
commit a90bbc3544
No known key found for this signature in database
GPG key ID: C3336907360768E1
5 changed files with 54 additions and 1 deletions

View file

@ -350,6 +350,18 @@ void Label::_notification(int p_what) {
RenderingServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), true);
}
// When a shaped text is invalidated by an external source, we want to reshape it.
if (!TS->shaped_text_is_ready(text_rid)) {
dirty = true;
}
for (const RID &line_rid : lines_rid) {
if (!TS->shaped_text_is_ready(line_rid)) {
lines_dirty = true;
break;
}
}
if (dirty || font_dirty || lines_dirty) {
_shape();
if (lines_dirty) {