allow scrolling with mousewheel

This commit is contained in:
lukas-heiligenbrunner 2022-11-14 13:46:07 +01:00
parent f532deb5ad
commit 692a1577d1

View File

@ -147,6 +147,14 @@ class _DrawingPageState extends State<DrawingPage> {
return Listener( return Listener(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onPointerMove: (e) => _onPointerMove(e, canvasSize), onPointerMove: (e) => _onPointerMove(e, canvasSize),
onPointerSignal: (pointerSignal) {
debugPrint('got pointer signal: $pointerSignal');
if (pointerSignal is PointerScrollEvent) {
final delta = pointerSignal.scrollDelta;
_calcNewPageOffset(-delta, size.width);
}
},
onPointerDown: (d) { onPointerDown: (d) {
Offset pos = d.localPosition; Offset pos = d.localPosition;
final scale = calcPageDependentScale(zoom, a4Page, canvasSize); final scale = calcPageDependentScale(zoom, a4Page, canvasSize);