diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-09-21 10:51:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-21 10:51:06 +0200 |
commit | 82f13288dddcb6add01ddec5cb62a31d85f92bfd (patch) | |
tree | a20c7b63a5f5d490c58b541fc8f27bbe20bc08a6 /editor/plugins | |
parent | 2d05e102b7596d14e69a0b6a4a7577225d5af4f0 (diff) | |
parent | 00755ff2c0b482a7346abe2b2523f1e8d8805547 (diff) |
Merge pull request #11453 from djrm/pr_visuals
Visual tweaks.
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index bb25576007..bc5f11e734 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2044,7 +2044,8 @@ void CanvasItemEditor::_viewport_base_gui_input(const Ref<InputEvent> &p_event) } void CanvasItemEditor::_draw_text_at_position(Point2 p_position, String p_string, Margin p_side) { - Color color = Color(0.8, 0.8, 0.8, 0.5); + Color color = get_color("font_color", "Editor"); + color.a = 0.8; Ref<Font> font = get_font("font", "Label"); Size2 text_size = font->get_string_size(p_string); switch (p_side) { @@ -2079,9 +2080,11 @@ void CanvasItemEditor::_draw_percentage_at_position(float p_value, Point2 p_posi } void CanvasItemEditor::_draw_rulers() { - Color graduation_color = Color(0.5, 0.5, 0.5, 1); + Color graduation_color = get_color("font_color", "Editor"); + graduation_color.a = 0.5; Color bg_color = get_color("dark_color_2", "Editor"); - Color font_color = Color(0.8, 0.8, 0.8, 1); + Color font_color = get_color("font_color", "Editor"); + font_color.a = 0.8; Ref<Font> font = get_font("rulers", "EditorFonts"); // The rule transform @@ -2182,13 +2185,14 @@ void CanvasItemEditor::_draw_grid() { real_grid_offset = grid_offset; } + const Color grid_minor_color = get_color("grid_minor_color", "Editor"); if (grid_step.x != 0) { for (int i = 0; i < s.width; i++) { int cell = Math::fast_ftoi(Math::floor((xform.xform(Vector2(i, 0)).x - real_grid_offset.x) / (grid_step.x * Math::pow(2.0, grid_step_multiplier)))); if (i == 0) last_cell = cell; if (last_cell != cell) - viewport->draw_line(Point2(i, 0), Point2(i, s.height), Color(0.3, 0.7, 1, 0.3)); + viewport->draw_line(Point2(i, 0), Point2(i, s.height), grid_minor_color); last_cell = cell; } } @@ -2199,7 +2203,7 @@ void CanvasItemEditor::_draw_grid() { if (i == 0) last_cell = cell; if (last_cell != cell) - viewport->draw_line(Point2(0, i), Point2(s.width, i), Color(0.3, 0.7, 1, 0.3)); + viewport->draw_line(Point2(0, i), Point2(s.width, i), grid_minor_color); last_cell = cell; } } |