Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert horiz scroll #1003

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions src/editor/lib/EditorControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,8 @@ THREE.EditorControls = function (_object, domElement) {
function onMouseWheel(event) {
event.preventDefault();

if (Math.abs(event.deltaY) > Math.abs(event.deltaX)) {
// Normalize deltaY due to https://bugzilla.mozilla.org/show_bug.cgi?id=1392460
scope.zoom(delta.set(0, 0, event.deltaY > 0 ? 1 : -1));
} else {
if (event.deltaX !== 0) {
// Pan the camera horizontally based on deltaX
// We use a smaller multiplier for horizontal scroll to make it less sensitive
scope.pan(delta.set(event.deltaX > 0 ? 10 : -10, 0, 0));
}
}
// Normalize deltaY due to https://bugzilla.mozilla.org/show_bug.cgi?id=1392460
scope.zoom(delta.set(0, 0, event.deltaY > 0 ? 1 : -1));
}

function contextmenu(event) {
Expand Down
Loading