You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-31 18:41:20 +00:00
Merge pull request #113908 from bruvzg/ts_dup_fix
[TextServer] Fix `duplicated` losing span info, and RID leak.
This commit is contained in:
@@ -155,6 +155,7 @@ Ref<TextLine> TextLine::duplicate() const {
|
||||
Ref<TextLine> copy;
|
||||
copy.instantiate();
|
||||
if (rid.is_valid()) {
|
||||
TS->free_rid(copy->rid);
|
||||
copy->rid = TS->shaped_text_duplicate(rid);
|
||||
}
|
||||
copy->dirty = true;
|
||||
|
||||
@@ -328,11 +328,13 @@ Ref<TextParagraph> TextParagraph::duplicate() const {
|
||||
Ref<TextParagraph> copy;
|
||||
copy.instantiate();
|
||||
if (dropcap_rid.is_valid()) {
|
||||
TS->free_rid(copy->dropcap_rid);
|
||||
copy->dropcap_rid = TS->shaped_text_duplicate(dropcap_rid);
|
||||
}
|
||||
copy->dropcap_lines = dropcap_lines;
|
||||
copy->dropcap_margins = dropcap_margins;
|
||||
if (rid.is_valid()) {
|
||||
TS->free_rid(copy->rid);
|
||||
copy->rid = TS->shaped_text_duplicate(rid);
|
||||
}
|
||||
copy->lines_dirty = true;
|
||||
|
||||
Reference in New Issue
Block a user