diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2020-12-16 15:48:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-16 15:48:55 +0100 |
commit | c514cc58224e5c973ac8be7bb6db7023d5c25906 (patch) | |
tree | 3ebf0efb621fd905622b13f810025f66340f4e55 | |
parent | 88b8c3ec00179e8438480edde047098d44846776 (diff) | |
parent | ec9796226138d1da6f7667d6cbdd6ec9258e424f (diff) |
Merge pull request #44429 from mbrlabs/rot-gizmo-handle
Changed the rotation gizmo handle to use the active axis color
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index c4fdf9f4bb..ff3b50303f 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -2657,11 +2657,30 @@ void Node3DEditorViewport::_draw() { if (_edit.mode == TRANSFORM_ROTATE) { Point2 center = _point_to_screen(_edit.center); + + Color handle_color; + switch (_edit.plane) { + case TRANSFORM_X_AXIS: + handle_color = get_theme_color("axis_x_color", "Editor"); + break; + case TRANSFORM_Y_AXIS: + handle_color = get_theme_color("axis_y_color", "Editor"); + break; + case TRANSFORM_Z_AXIS: + handle_color = get_theme_color("axis_z_color", "Editor"); + break; + default: + handle_color = get_theme_color("accent_color", "Editor"); + break; + } + handle_color.a = 1.0; + handle_color *= Color(1.3, 1.3, 1.3, 1.0); + RenderingServer::get_singleton()->canvas_item_add_line( ci, _edit.mouse_pos, center, - get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.6), + handle_color, Math::round(2 * EDSCALE)); } if (previewing) { |