Merge pull request #64305 from bruvzg/ts_reset_data

This commit is contained in:
Rémi Verschelde 2022-08-26 11:44:24 +02:00 committed by GitHub
commit d6267c2d2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1817,11 +1817,9 @@ void FontFile::set_data_ptr(const uint8_t *p_data, size_t p_size) {
data_ptr = p_data;
data_size = p_size;
if (data_ptr != nullptr) {
for (int i = 0; i < cache.size(); i++) {
if (cache[i].is_valid()) {
TS->font_set_data_ptr(cache[i], data_ptr, data_size);
}
for (int i = 0; i < cache.size(); i++) {
if (cache[i].is_valid()) {
TS->font_set_data_ptr(cache[i], data_ptr, data_size);
}
}
}
@ -1831,11 +1829,9 @@ void FontFile::set_data(const PackedByteArray &p_data) {
data_ptr = data.ptr();
data_size = data.size();
if (data_ptr != nullptr) {
for (int i = 0; i < cache.size(); i++) {
if (cache[i].is_valid()) {
TS->font_set_data_ptr(cache[i], data_ptr, data_size);
}
for (int i = 0; i < cache.size(); i++) {
if (cache[i].is_valid()) {
TS->font_set_data_ptr(cache[i], data_ptr, data_size);
}
}
}