Skip to content

Commit 15c9d96

Browse files
committed
Merge pull request #115796 from ryevdokimov/rotation-arc-aa
Add anti-aliasing to transform gizmo rotation arc
2 parents 3d2a2d3 + 5a4537c commit 15c9d96

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

editor/scene/3d/node_3d_editor_plugin.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3802,14 +3802,10 @@ void Node3DEditorViewport::_draw() {
38023802
}
38033803

38043804
Color circle_color = (_edit.plane == TRANSFORM_VIEW) ? Color(1.0, 1.0, 1.0, 0.8) : handle_color.from_hsv(handle_color.get_h(), 0.6, 1.0, 0.8);
3805-
for (int i = 0; i < circle_points.size() - 1; i++) {
3806-
RenderingServer::get_singleton()->canvas_item_add_line(
3807-
ci,
3808-
circle_points[i],
3809-
circle_points[i + 1],
3810-
circle_color,
3811-
Math::round(2 * EDSCALE));
3812-
}
3805+
Vector<Color> circle_colors;
3806+
circle_colors.resize(circle_points.size());
3807+
circle_colors.fill(circle_color);
3808+
RenderingServer::get_singleton()->canvas_item_add_polyline(ci, circle_points, circle_colors, Math::round(2 * EDSCALE), true);
38133809

38143810
const int segments = 64;
38153811
float display_angle = _edit.display_rotation_angle;
@@ -3866,7 +3862,8 @@ void Node3DEditorViewport::_draw() {
38663862
center,
38673863
start_point_2d,
38683864
edge_color,
3869-
Math::round(2 * EDSCALE));
3865+
Math::round(2 * EDSCALE),
3866+
true);
38703867

38713868
Vector3 end_point_3d = _edit.center + gizmo_scale * rotation_radius * (right * Math::cos(_edit.accumulated_rotation_angle) + forward * Math::sin(_edit.accumulated_rotation_angle));
38723869
Point2 end_point_2d = point_to_screen(end_point_3d);
@@ -3875,7 +3872,8 @@ void Node3DEditorViewport::_draw() {
38753872
center,
38763873
end_point_2d,
38773874
edge_color,
3878-
Math::round(2 * EDSCALE));
3875+
Math::round(2 * EDSCALE),
3876+
true);
38793877
}
38803878

38813879
if (_edit.show_rotation_line) {

0 commit comments

Comments
 (0)