You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-20 14:45:44 +00:00
Fix offset in Viewport drag movement
The initial offset was using the mouse position when the threshold was reached instead of the initial click position. This was adding the drag threshold distance as an extra offset to the final transformation. Now the offset is calculated from the initial click position.
This commit is contained in:
@@ -1749,7 +1749,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
||||
} else {
|
||||
const bool movement_threshold_passed = _edit.original_mouse_pos.distance_to(_edit.mouse_pos) > 8 * EDSCALE;
|
||||
if (clicked.is_valid() && movement_threshold_passed) {
|
||||
_compute_edit(_edit.mouse_pos);
|
||||
_compute_edit(_edit.original_mouse_pos);
|
||||
clicked = ObjectID();
|
||||
|
||||
_edit.mode = TRANSFORM_TRANSLATE;
|
||||
|
||||
Reference in New Issue
Block a user