diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/label.cpp | 4 | ||||
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 2 | ||||
-rw-r--r-- | scene/resources/dynamic_font.cpp | 15 | ||||
-rw-r--r-- | scene/resources/dynamic_font.h | 2 |
4 files changed, 10 insertions, 13 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index f74c2372c9..f1b0d36f32 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -93,7 +93,7 @@ void Label::_notification(int p_what) { bool use_outline = get_constant("shadow_as_outline"); Point2 shadow_ofs(get_constant("shadow_offset_x"), get_constant("shadow_offset_y")); int line_spacing = get_constant("line_spacing"); - Color font_outline_modulator = get_color("font_outline_modulator"); + Color font_outline_modulate = get_color("font_outline_modulate"); style->draw(ci, Rect2(Point2(0, 0), get_size())); @@ -151,7 +151,7 @@ void Label::_notification(int p_what) { int line = 0; int line_to = lines_skipped + (lines_visible > 0 ? lines_visible : 1); - FontDrawer drawer(font, font_outline_modulator); + FontDrawer drawer(font, font_outline_modulate); while (wc) { /* handle lines not meant to be drawn quickly */ if (line >= line_to) diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 5b9ebbd4e9..5ac9344f31 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -415,7 +415,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("font_color", "Label", Color(1, 1, 1)); theme->set_color("font_color_shadow", "Label", Color(0, 0, 0, 0)); - theme->set_color("font_outline_modulator", "Label", Color(1, 1, 1)); + theme->set_color("font_outline_modulate", "Label", Color(1, 1, 1)); theme->set_constant("shadow_offset_x", "Label", 1 * scale); theme->set_constant("shadow_offset_y", "Label", 1 * scale); diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 0f8db44596..f41a26a680 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -444,7 +444,7 @@ DynamicFontAtSize::TexturePosition DynamicFontAtSize::_find_texture_pos_for_glyp ret.x = 0; ret.y = 0; - int texsize = MAX(id.size * 8, 256); + int texsize = MAX(id.size * oversampling * 8, 256); if (mw > texsize) texsize = mw; //special case, adapt to it? if (mh > texsize) @@ -644,11 +644,9 @@ void DynamicFontAtSize::_update_char(CharType p_char) { char_map[p_char] = character; } -bool DynamicFontAtSize::update_oversampling() { - if (oversampling == font_oversampling) - return false; - if (!valid) - return false; +void DynamicFontAtSize::update_oversampling() { + if (oversampling == font_oversampling || !valid) + return; FT_Done_FreeType(library); textures.clear(); @@ -656,8 +654,6 @@ bool DynamicFontAtSize::update_oversampling() { oversampling = font_oversampling; valid = false; _load(); - - return true; } DynamicFontAtSize::DynamicFontAtSize() { @@ -1082,7 +1078,8 @@ void DynamicFont::update_oversampling() { SelfList<DynamicFont> *E = dynamic_fonts.first(); while (E) { - if (E->self()->data_at_size.is_valid() && E->self()->data_at_size->update_oversampling()) { + if (E->self()->data_at_size.is_valid()) { + E->self()->data_at_size->update_oversampling(); changed.push_back(Ref<DynamicFont>(E->self())); } E = E->next(); diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h index f024465ccd..f460bca2d4 100644 --- a/scene/resources/dynamic_font.h +++ b/scene/resources/dynamic_font.h @@ -192,7 +192,7 @@ public: float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks, bool p_advance_only = false) const; void set_texture_flags(uint32_t p_flags); - bool update_oversampling(); + void update_oversampling(); DynamicFontAtSize(); ~DynamicFontAtSize(); |