diff options
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/editor_preview_plugins.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 3b85fad345..ed1194efce 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -851,7 +851,9 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate_from_path(const String &p_path, Ref<Font> font = sampled_font; - font->draw_string(canvas_item, pos, sample, HORIZONTAL_ALIGNMENT_LEFT, -1.f, 50, Color(1, 1, 1)); + const Color c = GLOBAL_GET("rendering/environment/defaults/default_clear_color"); + const float fg = c.get_luminance() < 0.5 ? 1.0 : 0.0; + font->draw_string(canvas_item, pos, sample, HORIZONTAL_ALIGNMENT_LEFT, -1.f, 50, Color(fg, fg, fg)); RS::get_singleton()->connect(SNAME("frame_pre_draw"), callable_mp(const_cast<EditorFontPreviewPlugin *>(this), &EditorFontPreviewPlugin::_generate_frame_started), Vector<Variant>(), Object::CONNECT_ONESHOT); |