Skip to content

Commit

Permalink
Tickify Input.mousewheel event.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmarti committed Nov 26, 2023
1 parent 0967405 commit 5fe2397
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/viewer/scene/input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -1190,12 +1190,16 @@ class Input extends Component {
}
});

const tickifiedMouseWheelFn = this.scene.tickify(
(delta) => { this.fire("mousewheel", delta, true); }
);

this.element.addEventListener("wheel", this._mouseWheelListener = (e, d) => {
if (!this.enabled) {
return;
}
const delta = Math.max(-1, Math.min(1, -e.deltaY * 40));
this.fire("mousewheel", delta, true);
tickifiedMouseWheelFn(delta);
}, {passive: true});

// mouseclicked
Expand Down

0 comments on commit 5fe2397

Please sign in to comment.