mirror of
https://github.com/godotengine/godot.git
synced 2025-10-30 05:01:10 +00:00
Add an outline to box selection rectangles for better visibility
This also refactors selection box color definitions to avoid repetition.
This commit is contained in:
parent
de8ce3e625
commit
108f9646f5
5 changed files with 33 additions and 15 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue