allow scrolling with mousewheel
This commit is contained in:
parent
f532deb5ad
commit
692a1577d1
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user