Reverses scrolling direction for non-MacOS platforms

This commit is contained in:
Doflatango
2022-12-01 17:34:03 +08:00
parent 645ebb08a6
commit 19561655ec

View File

@@ -154,7 +154,12 @@ void WebviewHandler::sendScrollEvent(int x, int y, int deltaX, int deltaY) {
CefMouseEvent ev;
ev.x = x;
ev.y = y;
(*it)->GetHost()->SendMouseWheelEvent(ev, deltaX, deltaY);
#ifndef __APPLE__
// The scrolling direction on Windows and Linux is different from MacOS
deltaY = -deltaY;
#endif
(*it)->GetHost()->SendMouseWheelEvent(ev, deltaX, deltaY);
}
}