Skip to content

Commit

Permalink
Fix moving on canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Oct 27, 2023
1 parent 5eab396 commit 518946c
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions app/lib/views/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,16 @@ class _MainViewViewportState extends State<MainViewViewport>
await changeTemporaryTool(
event.kind, event.buttons);
}
getHandler()
.onPointerDown(event, getEventContext());
if (_isScalingDisabled ?? true) {
getHandler()
.onPointerDown(event, getEventContext());
}
},
onPointerUp: (PointerUpEvent event) async {
getHandler().onPointerUp(event, getEventContext());
if (_isScalingDisabled ?? true) {
getHandler()
.onPointerUp(event, getEventContext());
}
cubit.removePointer(event.pointer);
cubit.removeButtons();
Future.sync(() => cubit.resetTemporaryHandler(
Expand All @@ -323,12 +328,16 @@ class _MainViewViewportState extends State<MainViewViewport>
cubit.move(event.delta / transform.size);
delayBake();
}
getHandler().onPointerGestureMove(
event, getEventContext());
if (_isScalingDisabled ?? true) {
getHandler().onPointerGestureMove(
event, getEventContext());
}
return;
}
getHandler()
.onPointerMove(event, getEventContext());
if (_isScalingDisabled ?? true) {
getHandler()
.onPointerMove(event, getEventContext());
}
},
child: BlocBuilder<TransformCubit, CameraTransform>(
builder: (context, transform) => MouseRegion(
Expand Down

0 comments on commit 518946c

Please sign in to comment.