1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-21 14:57:09 +00:00

[Web] Fix Web MouseWheel scrolling

This commit is contained in:
Adam Scott
2025-05-13 13:09:59 -04:00
parent f92f1ce9c0
commit 6e5994eca8
4 changed files with 34 additions and 11 deletions

View File

@@ -526,7 +526,7 @@ const GodotInput = {
godot_js_input_mouse_wheel_cb: function (callback) {
const func = GodotRuntime.get_func(callback);
function wheel_cb(evt) {
if (func(evt['deltaX'] || 0, evt['deltaY'] || 0)) {
if (func(evt.deltaMode, evt.deltaX ?? 0, evt.deltaY ?? 0)) {
evt.preventDefault();
}
}