Skip to content

Commit 8554bb4

Browse files
authored
Reduce scroll multiplier (#314)
1 parent c172880 commit 8554bb4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

windows/webview.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,18 @@ void Webview::SetPointerButtonState(WebviewPointerButton button, bool is_down) {
631631
}
632632

633633
void Webview::SendScroll(double delta, bool horizontal) {
634-
// delta * 6 gives me a multiple of WHEEL_DELTA (120)
635-
constexpr auto kScrollMultiplier = 6;
634+
// clang-format off
635+
//
636+
// TODO:
637+
// Using a fixed value here is certainly wrong. Flutter's calculation in flutter_window.cc
638+
// needs to be inverted to get back the "native" value. See
639+
// - https://github.com/flutter/engine/blob/82c1dfcf588c2669ca391134910d634ca31fddf1/shell/platform/windows/flutter_window.cc#L416-L426
640+
// Related:
641+
// - https://source.chromium.org/chromium/chromium/src/+/main:ui/events/blink/web_input_event_builders_win.cc
642+
// - https://github.com/flutter/flutter/issues/107248
643+
//
644+
// clang-format on
645+
constexpr auto kScrollMultiplier = 1.5;
636646

637647
auto offset = static_cast<short>(delta * kScrollMultiplier);
638648

0 commit comments

Comments
 (0)