Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

Browser inconsistencies in scrollY because deltaMode not used calculate wheelEvent deltas #149

@thomasballinger

Description

@thomasballinger

Part of the solution to emscripten-core/emscripten#6283 appears to be to use wheelEvent->deltaMode in Emscripten_HandleWheel to calculate the deltaY.

The conversions used in a fix for libraries using library_browser.js instead of library_html5.js are:

case 0:
  // DOM_DELTA_PIXEL: 100 pixels make up a step
  delta /= 100;
  break;
case 1:
  // DOM_DELTA_LINE: 3 lines make up a step
  delta /= 3;
  break;
case 2:
  // DOM_DELTA_PAGE: A page makes up 80 steps
  delta *= 80;
  break;

Does adding this logic here make sense, should I prep a PR?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions