summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-04 17:45:01 +0200
committerGitHub <noreply@github.com>2019-04-04 17:45:01 +0200
commitd9b9c9f98a76127b1e32c019fe5a93a2bec40d77 (patch)
treed02921b50360ecc86370cc1b96471041529a847e /editor/plugins
parent3a7a1cd4c9e61ad16beeff60d54a32247c97423e (diff)
parentd59b210aeccf5de8454a37ef5da5e9f631302f25 (diff)
Merge pull request #27567 from Calinou/selection-boxes-use-accent-color
Use the editor theme's accent color for 2D/3D selections and rotations
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp13
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp13
2 files changed, 21 insertions, 5 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 37ae2d146c..dc1a8ade9f 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2828,13 +2828,20 @@ 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, Rect2(bsfrom, bsto - bsfrom), Color(0.7, 0.7, 1.0, 0.3));
+ VisualServer::get_singleton()->canvas_item_add_rect(
+ ci,
+ Rect2(bsfrom, bsto - bsfrom),
+ get_color("accent_color", "Editor") * Color(1, 1, 1, 0.375));
}
- Color rotate_color(0.4, 0.7, 1.0, 0.8);
if (drag_type == DRAG_ROTATE) {
// Draw the line when rotating a node
- viewport->draw_line(transform.xform(drag_rotation_center), transform.xform(drag_to), rotate_color);
+ viewport->draw_line(
+ transform.xform(drag_rotation_center),
+ transform.xform(drag_to),
+ get_color("accent_color", "Editor") * Color(1, 1, 1, 0.6),
+ Math::round(2 * EDSCALE),
+ true);
}
}
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index 765d198f79..e3b51858ec 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -2382,7 +2382,10 @@ void SpatialEditorViewport::_draw() {
if (cursor.region_select) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor.region_begin, cursor.region_end - cursor.region_begin), Color(0.7, 0.7, 1.0, 0.3));
+ 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));
}
if (message_time > 0) {
@@ -2396,7 +2399,13 @@ void SpatialEditorViewport::_draw() {
if (_edit.mode == TRANSFORM_ROTATE) {
Point2 center = _point_to_screen(_edit.center);
- VisualServer::get_singleton()->canvas_item_add_line(ci, _edit.mouse_pos, center, Color(0.4, 0.7, 1.0, 0.8));
+ VisualServer::get_singleton()->canvas_item_add_line(
+ ci,
+ _edit.mouse_pos,
+ center,
+ get_color("accent_color", "Editor") * Color(1, 1, 1, 0.6),
+ Math::round(2 * EDSCALE),
+ true);
}
if (previewing) {