summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHayden Leete <haydenleete@gmail.com>2022-06-02 21:15:15 +1200
committerHayden Leete <haydenleete@gmail.com>2022-06-02 21:15:15 +1200
commit90b39f95dab146b28c2e924f74da506a18b5a657 (patch)
treeae2b9379c77397883901aeebb859378c64163a48
parent6cd730ea98595089aa8506354755059b07d0ce21 (diff)
swap path_3d_editor_plugin control points order
-rw-r--r--editor/plugins/path_3d_editor_plugin.cpp20
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) {