Fix trackball not highlighting immediately when toggling Use Trackball
This commit is contained in:
@@ -4717,6 +4717,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"];
|
||||
@@ -7472,6 +7479,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,6 +566,7 @@ protected:
|
||||
public:
|
||||
void update_surface() { surface->queue_redraw(); }
|
||||
void update_transform_gizmo_view();
|
||||
void update_transform_gizmo_highlight();
|
||||
|
||||
void set_can_preview(Camera3D *p_preview);
|
||||
void set_state(const Dictionary &p_state);
|
||||
|
||||
Reference in New Issue
Block a user