Merge pull request #115992 from ryevdokimov/fix-trackball-highlight

Fix trackball not highlighting immediately when toggling `Use Trackball`
This commit is contained in:
Thaddeus Crews 2026-02-11 10:27:01 -06:00
commit 152f142788
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
2 changed files with 11 additions and 0 deletions

View file

@ -4741,6 +4741,13 @@ void Node3DEditorViewport::update_transform_gizmo_view() {
rs->instance_set_visible(axis_gizmo_instance[2], show_axes && (_edit.plane == TRANSFORM_Z_AXIS || _edit.plane == TRANSFORM_XZ || _edit.plane == TRANSFORM_YZ));
}
void Node3DEditorViewport::update_transform_gizmo_highlight() {
if (!is_visible_in_tree() || !Rect2(Vector2(), surface->get_size()).has_point(surface->get_local_mouse_position())) {
return;
}
_transform_gizmo_select(surface->get_local_mouse_position(), true);
}
void Node3DEditorViewport::set_state(const Dictionary &p_state) {
if (p_state.has("position")) {
cursor.pos = p_state["position"];
@ -7509,6 +7516,9 @@ void Node3DEditor::_menu_item_toggled(bool pressed, int p_option) {
case MENU_TOOL_USE_TRACKBALL: {
tool_option_button[TOOL_OPT_USE_TRACKBALL]->set_pressed(pressed);
trackball_enabled = pressed;
for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) {
viewports[i]->update_transform_gizmo_highlight();
}
} break;
}
}