Skip to content
Permalink
Browse files

only set wheel on canvas instead of window level event, fix scrolling…

… in chrome 73+
  • Loading branch information...
UnknownShadow200 committed May 7, 2019
1 parent b90d340 commit e1a8c6f8ffd367193111ce3d6167586934ae503f
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Window.c
@@ -2732,7 +2732,7 @@ static EM_BOOL Window_KeyPress(int type, const EmscriptenKeyboardEvent* ev, void
}

static void Window_HookEvents(void) {
emscripten_set_wheel_callback("#window", NULL, 0, Window_MouseWheel);
emscripten_set_wheel_callback("#canvas", NULL, 0, Window_MouseWheel);
emscripten_set_mousedown_callback("#canvas", NULL, 0, Window_MouseButton);
emscripten_set_mouseup_callback("#canvas", NULL, 0, Window_MouseButton);
emscripten_set_mousemove_callback("#canvas", NULL, 0, Window_MouseMove);
@@ -2750,7 +2750,7 @@ static void Window_HookEvents(void) {
}

static void Window_UnhookEvents(void) {
emscripten_set_wheel_callback("#window", NULL, 0, NULL);
emscripten_set_wheel_callback("#canvas", NULL, 0, NULL);
emscripten_set_mousedown_callback("#canvas", NULL, 0, NULL);
emscripten_set_mouseup_callback("#canvas", NULL, 0, NULL);
emscripten_set_mousemove_callback("#canvas", NULL, 0, NULL);

0 comments on commit e1a8c6f

Please sign in to comment.
You can’t perform that action at this time.