[FontData] Fixes saving copy of the font source data, if it was created from built-in font.
This commit is contained in:
parent
df57aa670a
commit
2e035272a8
1 changed files with 5 additions and 0 deletions
|
@ -502,6 +502,11 @@ void FontData::set_data(const PackedByteArray &p_data) {
|
|||
}
|
||||
|
||||
PackedByteArray FontData::get_data() const {
|
||||
if (unlikely((size_t)data.size() != data_size)) {
|
||||
PackedByteArray *data_w = const_cast<PackedByteArray *>(&data);
|
||||
data_w->resize(data_size);
|
||||
memcpy(data_w->ptrw(), data_ptr, data_size);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue