Fix viewport orbit snap defaulting to always snapping when shortcut(s) are set to none
(cherry picked from commit 7b2b3b41ee2f5fe1aa40527373929b22920d7c0e)
This commit is contained in:
committed by
Thaddeus Crews
parent
b553150425
commit
c773197ca5
@@ -2865,8 +2865,9 @@ void Node3DEditorViewport::_nav_orbit(Ref<InputEventWithModifiers> p_event, cons
|
||||
cursor.x_rot = cursor.unsnapped_x_rot;
|
||||
cursor.y_rot = cursor.unsnapped_y_rot;
|
||||
|
||||
if (_is_nav_modifier_pressed("spatial_editor/viewport_orbit_snap_modifier_1") &&
|
||||
_is_nav_modifier_pressed("spatial_editor/viewport_orbit_snap_modifier_2")) {
|
||||
bool snap_modifier_configured = !_is_shortcut_empty("spatial_editor/viewport_orbit_snap_modifier_1") || !_is_shortcut_empty("spatial_editor/viewport_orbit_snap_modifier_2");
|
||||
|
||||
if (snap_modifier_configured && _is_nav_modifier_pressed("spatial_editor/viewport_orbit_snap_modifier_1") && _is_nav_modifier_pressed("spatial_editor/viewport_orbit_snap_modifier_2")) {
|
||||
const real_t snap_angle = Math::deg_to_rad(45.0);
|
||||
const real_t snap_threshold = Math::deg_to_rad((real_t)EDITOR_GET("editors/3d/navigation_feel/angle_snap_threshold"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user