Merge pull request #33 from Doflatango/fix/scrolling

调整滚动行为和滚动增量
This commit is contained in:
Prome
2022-12-01 21:28:09 +08:00
committed by GitHub

View File

@@ -154,7 +154,17 @@ void WebviewHandler::sendScrollEvent(int x, int y, int deltaX, int deltaY) {
CefMouseEvent ev;
ev.x = x;
ev.y = y;
#ifndef __APPLE__
// The scrolling direction on Windows and Linux is different from MacOS
deltaY = -deltaY;
// Flutter scrolls too slowly, it looks more normal by 10x default speed.
(*it)->GetHost()->SendMouseWheelEvent(ev, deltaX * 10, deltaY * 10);
#else
(*it)->GetHost()->SendMouseWheelEvent(ev, deltaX, deltaY);
#endif
}
}