Changed the rotation gizmo handle to use the active axis color

(cherry picked from commit ec97962261)
This commit is contained in:
Marcus Brummer 2020-12-16 14:32:02 +01:00 committed by Rémi Verschelde
parent bafbb238af
commit 9248ee39ca
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 20 additions and 1 deletions

View File

@ -2644,11 +2644,30 @@ void SpatialEditorViewport::_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_color("axis_x_color", "Editor");
break;
case TRANSFORM_Y_AXIS:
handle_color = get_color("axis_y_color", "Editor");
break;
case TRANSFORM_Z_AXIS:
handle_color = get_color("axis_z_color", "Editor");
break;
default:
handle_color = get_color("accent_color", "Editor");
break;
}
handle_color.a = 1.0;
handle_color *= Color(1.3, 1.3, 1.3, 1.0);
VisualServer::get_singleton()->canvas_item_add_line(
ci,
_edit.mouse_pos,
center,
get_color("accent_color", "Editor") * Color(1, 1, 1, 0.6),
handle_color,
Math::round(2 * EDSCALE),
true);
}