Skip to content

Commit a68d26c

Browse files
committed
Merge pull request #112659 from passivestar/ruler-visibility-fix
Fix 2D ruler visibility in modern theme
2 parents df51b14 + fac37c6 commit a68d26c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

editor/scene/canvas_item_editor_plugin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,10 +3170,10 @@ void CanvasItemEditor::_draw_smart_snapping() {
31703170
}
31713171

31723172
void CanvasItemEditor::_draw_rulers() {
3173-
Color bg_color = get_theme_color(SNAME("dark_color_2"), EditorStringName(Editor));
3173+
Color bg_color = get_theme_color(SNAME("ruler_color"), EditorStringName(Editor));
31743174
Color graduation_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)).lerp(bg_color, 0.5);
31753175
Color font_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
3176-
font_color.a = 0.8;
3176+
font_color.a = 0.9;
31773177
Ref<Font> font = get_theme_font(SNAME("rulers"), EditorStringName(EditorFonts));
31783178
real_t ruler_tick_scale = ruler_width_scaled / 15.0;
31793179
const String lang = _get_locale();

editor/themes/theme_classic.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ void ThemeClassic::populate_shared_styles(const Ref<EditorTheme> &p_theme, Edito
8686
p_theme->set_color("success_color", EditorStringName(Editor), p_config.success_color);
8787
p_theme->set_color("warning_color", EditorStringName(Editor), p_config.warning_color);
8888
p_theme->set_color("error_color", EditorStringName(Editor), p_config.error_color);
89+
p_theme->set_color("ruler_color", EditorStringName(Editor), p_config.dark_color_2);
8990
#ifndef DISABLE_DEPRECATED // Used before 4.3.
9091
p_theme->set_color("disabled_highlight_color", EditorStringName(Editor), p_config.highlight_disabled_color);
9192
#endif

editor/themes/theme_modern.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ void ThemeModern::populate_shared_styles(const Ref<EditorTheme> &p_theme, Editor
9797
p_theme->set_color("success_color", EditorStringName(Editor), p_config.success_color);
9898
p_theme->set_color("warning_color", EditorStringName(Editor), p_config.warning_color);
9999
p_theme->set_color("error_color", EditorStringName(Editor), p_config.error_color);
100+
p_theme->set_color("ruler_color", EditorStringName(Editor), p_config.base_color.lerp(p_config.mono_color_inv, 0.3) * Color(1, 1, 1, 0.8));
100101
#ifndef DISABLE_DEPRECATED // Used before 4.3.
101102
p_theme->set_color("disabled_highlight_color", EditorStringName(Editor), p_config.highlight_disabled_color);
102103
#endif

0 commit comments

Comments
 (0)