Merge pull request #15495 from poke1024/font-oversampling

Two potential glitches in font oversampling
This commit is contained in:
Rémi Verschelde 2018-01-09 16:03:13 +01:00 committed by GitHub
commit e1c799f1b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -631,6 +631,7 @@ bool DynamicFontAtSize::update_oversampling() {
textures.clear();
char_map.clear();
oversampling = font_oversampling;
valid = false;
_load();
return true;
@ -973,14 +974,26 @@ void DynamicFont::finish_dynamic_fonts() {
void DynamicFont::update_oversampling() {
Vector<Ref<DynamicFont> > changed;
if (dynamic_font_mutex)
dynamic_font_mutex->lock();
SelfList<DynamicFont> *E = dynamic_fonts.first();
while (E) {
if (E->self()->data_at_size.is_valid() && E->self()->data_at_size->update_oversampling()) {
E->self()->emit_changed();
changed.push_back(E->self());
}
E = E->next();
}
if (dynamic_font_mutex)
dynamic_font_mutex->unlock();
for (int i = 0; i < changed.size(); i++) {
changed[i]->emit_changed();
}
}
/////////////////////////