mirror of
https://github.com/godotengine/godot
synced 2024-09-05 09:28:51 +00:00
[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
|
@ -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