I have no idea why this commit fixes #15392

(cherry picked from commit 8daf5491ab)
This commit is contained in:
Juan Linietsky 2018-01-21 16:18:52 -03:00 committed by Rémi Verschelde
parent bc0af4a73e
commit 2c47116a3c
2 changed files with 11 additions and 14 deletions

View File

@ -34,13 +34,7 @@
bool DynamicFontData::CacheID::operator<(CacheID right) const {
if (size < right.size)
return true;
if (mipmaps != right.mipmaps)
return right.mipmaps;
if (filter != right.filter)
return right.filter;
return false;
return key < right.key;
}
Ref<DynamicFontAtSize> DynamicFontData::_get_dynamic_font_at_size(CacheID p_id) {
@ -616,6 +610,7 @@ DynamicFontAtSize::~DynamicFontAtSize() {
FT_Done_FreeType(library);
}
font->size_cache.erase(id);
font.unref();
}
/////////////////////////

View File

@ -48,15 +48,17 @@ class DynamicFontData : public Resource {
public:
struct CacheID {
int size;
bool mipmaps;
bool filter;
union {
struct {
uint32_t size : 16;
bool mipmaps : 1;
bool filter : 1;
};
uint32_t key;
};
bool operator<(CacheID right) const;
CacheID() {
size = 16;
mipmaps = false;
filter = false;
key = 0;
}
};