Web: Adjust the scroll wheel sensitivity for zooming.
parent
6fc84ae2ce
commit
50cbecbe72
|
@ -808,13 +808,18 @@ public:
|
||||||
MouseEvent event = {};
|
MouseEvent event = {};
|
||||||
if(emEvent->deltaY != 0) {
|
if(emEvent->deltaY != 0) {
|
||||||
event.type = MouseEvent::Type::SCROLL_VERT;
|
event.type = MouseEvent::Type::SCROLL_VERT;
|
||||||
event.scrollDelta = -emEvent->deltaY * 0.1;
|
// FIXME(emscripten):
|
||||||
|
// Pay attention to:
|
||||||
|
// dbp("Mouse wheel delta mode: %lu", emEvent->deltaMode);
|
||||||
|
// https://emscripten.org/docs/api_reference/html5.h.html#id11
|
||||||
|
// https://www.w3.org/TR/DOM-Level-3-Events/#dom-wheelevent-deltamode
|
||||||
|
// and adjust the 0.01 below. deltaMode == 0 on a Firefox on a Windows.
|
||||||
|
event.scrollDelta = -emEvent->deltaY * 0.01;
|
||||||
} else {
|
} else {
|
||||||
return EM_FALSE;
|
return EM_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
EmscriptenMouseEvent emStatus = {};
|
const EmscriptenMouseEvent &emStatus = emEvent->mouse;
|
||||||
sscheck(emscripten_get_mouse_status(&emStatus));
|
|
||||||
event.x = emStatus.targetX;
|
event.x = emStatus.targetX;
|
||||||
event.y = emStatus.targetY;
|
event.y = emStatus.targetY;
|
||||||
event.shiftDown = emStatus.shiftKey;
|
event.shiftDown = emStatus.shiftKey;
|
||||||
|
|
Loading…
Reference in New Issue