Skip to content

Commit

Permalink
Drawing outside window#521 (#646)
Browse files Browse the repository at this point in the history
* pub

* Revert "pub"

This reverts commit 32588e6.

* fix DrowingOutsideWindow

* remove pubspec.lock

* add pubspec.lock

* edit pubspec

* Drawing outside window#521

* remove onExit and duplicate import
  • Loading branch information
MrGumpIT committed Mar 27, 2024
1 parent d031b23 commit 7f69740
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/lib/views/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ class _MainViewViewportState extends State<MainViewViewport>
.onPointerHover(event, getEventContext());
},
onPointerMove: (PointerMoveEvent event) async {
RenderObject? box = context.findRenderObject();
if (!box!.paintBounds
.contains(event.localPosition) &&
kIsWeb) {
return;
}
cubit.updateLastPosition(event.localPosition);
if (cubit.state.moveEnabled &&
event.kind != PointerDeviceKind.stylus) {
Expand Down Expand Up @@ -419,9 +425,6 @@ class _MainViewViewportState extends State<MainViewViewport>
child: BlocBuilder<TransformCubit, CameraTransform>(
builder: (context, transform) => MouseRegion(
cursor: currentIndex.currentCursor,
onExit: kIsWeb
? (event) => cubit.resetInput(context.read<DocumentBloc>())
: null,
child: AnimatedBuilder(
animation: _animationController,
builder: (context, child) {
Expand Down

0 comments on commit 7f69740

Please sign in to comment.