From 108f9646f544076708f1b7418960193950cb6208 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 15 Aug 2019 22:17:08 +0200 Subject: Add an outline to box selection rectangles for better visibility This also refactors selection box color definitions to avoid repetition. --- editor/plugins/canvas_item_editor_plugin.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'editor/plugins/canvas_item_editor_plugin.cpp') diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 98c2f21e45..cc707dbf44 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2918,10 +2918,15 @@ void CanvasItemEditor::_draw_selection() { Point2 bsfrom = transform.xform(drag_from); Point2 bsto = transform.xform(box_selecting_to); - VisualServer::get_singleton()->canvas_item_add_rect( - ci, + viewport->draw_rect( Rect2(bsfrom, bsto - bsfrom), - get_color("accent_color", "Editor") * Color(1, 1, 1, 0.375)); + get_color("box_selection_fill_color", "Editor")); + + viewport->draw_rect( + Rect2(bsfrom, bsto - bsfrom), + get_color("box_selection_stroke_color", "Editor"), + false, + Math::round(EDSCALE)); } if (drag_type == DRAG_ROTATE) { -- cgit v1.2.3