diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-08-17 11:26:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-17 11:26:05 +0200 |
commit | be42f1bf6cd1fa18321bbd24b77955ddcd535f7e (patch) | |
tree | 2dfc3206e49ed8819b26041f978246eabbe01897 /editor/plugins/spatial_editor_plugin.cpp | |
parent | c7a7163dff974fbfaa17ff934e03dea3b5ff9885 (diff) | |
parent | 108f9646f544076708f1b7418960193950cb6208 (diff) |
Merge pull request #31399 from Calinou/box-selection-add-borders
Add an outline to box selection rectangles for better visibility
Diffstat (limited to 'editor/plugins/spatial_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index f2b1aad59d..20a06f3ac0 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2373,16 +2373,22 @@ void SpatialEditorViewport::_draw() { get_stylebox("Focus", "EditorStyles")->draw(surface->get_canvas_item(), r); } - RID ci = surface->get_canvas_item(); - if (cursor.region_select) { + const Rect2 selection_rect = Rect2(cursor.region_begin, cursor.region_end - cursor.region_begin); - VisualServer::get_singleton()->canvas_item_add_rect( - ci, - Rect2(cursor.region_begin, cursor.region_end - cursor.region_begin), - get_color("accent_color", "Editor") * Color(1, 1, 1, 0.375)); + surface->draw_rect( + selection_rect, + get_color("box_selection_fill_color", "Editor")); + + surface->draw_rect( + selection_rect, + get_color("box_selection_stroke_color", "Editor"), + false, + Math::round(EDSCALE)); } + RID ci = surface->get_canvas_item(); + if (message_time > 0) { Ref<Font> font = get_font("font", "Label"); Point2 msgpos = Point2(5, get_size().y - 20); |