Skip to content

Commit

Permalink
Fix two-finger touchpad scrolling not work (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Channing-dong authored Nov 7, 2024
1 parent 8554bb4 commit 5e156e4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/src/webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';

import 'enums.dart';
import 'cursor.dart';
import 'enums.dart';

class HistoryChanged {
final bool canGoBack;
Expand Down Expand Up @@ -741,8 +741,11 @@ class _WebviewState extends State<Webview> {
}
},
onPointerPanZoomUpdate: (signal) {
_controller._setScrollDelta(
signal.panDelta.dx, signal.panDelta.dy);
if (signal.panDelta.dx.abs() > signal.panDelta.dy.abs()) {
_controller._setScrollDelta(-signal.panDelta.dx, 0);
} else {
_controller._setScrollDelta(0, signal.panDelta.dy);
}
},
child: MouseRegion(
cursor: _cursor,
Expand Down

0 comments on commit 5e156e4

Please sign in to comment.