Prechádzať zdrojové kódy

Merge pull request #89607 from AThousandShips/handle_id_fix

[Editor] Fix handle ID being passed for 3D Gizmo plugins
Rémi Verschelde 1 rok pred
rodič
commit
4e6d96299d
1 zmenil súbory, kde vykonal 3 pridanie a 2 odobranie
  1. 3 2
      editor/plugins/node_3d_editor_gizmos.cpp

+ 3 - 2
editor/plugins/node_3d_editor_gizmos.cpp

@@ -431,12 +431,13 @@ void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<
 		colors.resize(p_handles.size());
 		colors.resize(p_handles.size());
 		Color *w = colors.ptrw();
 		Color *w = colors.ptrw();
 		for (int i = 0; i < p_handles.size(); i++) {
 		for (int i = 0; i < p_handles.size(); i++) {
+			int id = p_ids.is_empty() ? i : p_ids[i];
+
 			Color col(1, 1, 1, 1);
 			Color col(1, 1, 1, 1);
-			if (is_handle_highlighted(i, p_secondary)) {
+			if (is_handle_highlighted(id, p_secondary)) {
 				col = Color(0, 0, 1, 0.9);
 				col = Color(0, 0, 1, 0.9);
 			}
 			}
 
 
-			int id = p_ids.is_empty() ? i : p_ids[i];
 			if (!is_current_hover_gizmo || current_hover_handle != id || p_secondary != current_hover_handle_secondary) {
 			if (!is_current_hover_gizmo || current_hover_handle != id || p_secondary != current_hover_handle_secondary) {
 				col.a = 0.8;
 				col.a = 0.8;
 			}
 			}