mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix font preview text color on light background
This commit is contained in:
parent
58712e96ae
commit
1fb59d13c2
5 changed files with 16 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue