diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-06-02 18:51:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-02 18:51:36 +0200 |
commit | 1baee2189c21ae36c852ddff10f769b1134509ca (patch) | |
tree | 3d0bac0488dd56cc5d7b0c6c2f78378dd92a6b66 /editor/plugins | |
parent | f606225608e4dafb93462b8fe46584d0da73dfb2 (diff) | |
parent | 90b39f95dab146b28c2e924f74da506a18b5a657 (diff) |
Merge pull request #61626 from Haydoggo/path-editor-handle-swap
Swap Path3DGizmo control points order
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/path_3d_editor_plugin.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index 3851738cfa..467af8c34b 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -52,7 +52,7 @@ String Path3DGizmo::get_handle_name(int p_id, bool p_secondary) const { int idx = p_id / 2; int t = p_id % 2; String n = TTR("Curve Point #") + itos(idx); - if (t == 0) { + if (t == 1) { n += " In"; } else { n += " Out"; @@ -78,7 +78,7 @@ Variant Path3DGizmo::get_handle_value(int p_id, bool p_secondary) const { int t = p_id % 2; Vector3 ofs; - if (t == 0) { + if (t == 1) { ofs = c->get_point_in(idx); } else { ofs = c->get_point_out(idx); @@ -144,7 +144,7 @@ void Path3DGizmo::set_handle(int p_id, bool p_secondary, Camera3D *p_camera, con local.snap(Vector3(snap, snap, snap)); } - if (t == 0) { + if (t == 1) { c->set_point_in(idx, local); if (Path3DEditorPlugin::singleton->mirror_angle_enabled()) { c->set_point_out(idx, Path3DEditorPlugin::singleton->mirror_length_enabled() ? -local : (-local.normalized() * orig_out_length)); @@ -184,7 +184,7 @@ void Path3DGizmo::commit_handle(int p_id, bool p_secondary, const Variant &p_res int idx = p_id / 2; int t = p_id % 2; - if (t == 0) { + if (t == 1) { if (p_cancel) { c->set_point_in(p_id, p_restore); return; @@ -263,17 +263,17 @@ void Path3DGizmo::redraw() { for (int i = 0; i < c->get_point_count(); i++) { Vector3 p = c->get_point_position(i); handles.push_back(p); - if (i > 0) { - v3p.push_back(p); - v3p.push_back(p + c->get_point_in(i)); - sec_handles.push_back(p + c->get_point_in(i)); - } - + // push Out points first so they get selected if the In and Out points are on top of each other. if (i < c->get_point_count() - 1) { v3p.push_back(p); v3p.push_back(p + c->get_point_out(i)); sec_handles.push_back(p + c->get_point_out(i)); } + if (i > 0) { + v3p.push_back(p); + v3p.push_back(p + c->get_point_in(i)); + sec_handles.push_back(p + c->get_point_in(i)); + } } if (v3p.size() > 1) { |