Skip to content

Mouse scroll delta is not scaled properly #6283

@ghost

Description

I've done some digging and I think this is true for all scrolling in all libraries.

Using GLFW to listen to scroll events (glfwSetScrollCallback) gives me two doubles: Y and X delta. These are majorly differing between Firefox and Chrome (because as I have found, you should scale the delta according to if you get PIXELS or LINES).

In library_glfw.js, glfwInit function you listen to 'wheel' event (and others), handler is GLFW.onMouseWheel. There you call Browser.getMouseWheelDelta which for the 'wheel' event simply returns deltaY. Then this delta is just passed up to GLFW handlers.

What needs to be done is to properly handle the WheelEvent.deltaMode which can be DOM_DELTA_PIXEL or DOM_DELTA_LINE or even DOM_DELTA_PAGE.

When Firefox gives delta in LINES and Chrome gives delta in PIXELS there's a major inconsistency for apps run in those two browsers. Browser.getMouseWheelDelta is used by all libraries it seems to this issue should affect all scrolling.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions