diff --git a/app/lib/cubits/current_index.dart b/app/lib/cubits/current_index.dart index 36dedc716e7e..b170f58389fc 100644 --- a/app/lib/cubits/current_index.dart +++ b/app/lib/cubits/current_index.dart @@ -363,5 +363,9 @@ class CurrentIndexCubit extends Cubit { location: location ?? state.location, saved: saved ?? state.saved)); } - void resetInput() {} + void resetInput() { + state.temporaryHandler?.resetInput(); + state.handler.resetInput(); + emit(state.copyWith(pointers: [])); + } } diff --git a/app/lib/handlers/area.dart b/app/lib/handlers/area.dart index 94f026b6130e..f4ed0b2e67da 100644 --- a/app/lib/handlers/area.dart +++ b/app/lib/handlers/area.dart @@ -21,7 +21,7 @@ class AreaHandler extends Handler { ]; @override - void resetInput(DocumentBloc bloc) => currentRect = null; + void resetInput() => currentRect = null; @override void onPointerDown( diff --git a/app/lib/handlers/handler.dart b/app/lib/handlers/handler.dart index ceff2cc6bfab..b56f43787a31 100644 --- a/app/lib/handlers/handler.dart +++ b/app/lib/handlers/handler.dart @@ -82,6 +82,8 @@ abstract class Handler { void onLongPressEnd( Size viewportSize, BuildContext context, LongPressEndDetails details) {} + void resetInput() {} + int? getColor(DocumentBloc bloc) => null; T? setColor(DocumentBloc bloc, int color) => null; diff --git a/app/lib/handlers/shape.dart b/app/lib/handlers/shape.dart index b7c132d7fa54..53938b7caaa1 100644 --- a/app/lib/handlers/shape.dart +++ b/app/lib/handlers/shape.dart @@ -17,7 +17,7 @@ class ShapeHandler extends Handler { } @override - void resetInput(DocumentBloc bloc) { + void resetInput() { elements.clear(); submittedElements.clear(); } diff --git a/app/lib/views/view.dart b/app/lib/views/view.dart index deb54523c137..b507823f8bf0 100644 --- a/app/lib/views/view.dart +++ b/app/lib/views/view.dart @@ -178,7 +178,6 @@ class _MainViewViewportState extends State }, onPointerDown: (PointerDownEvent event) { cubit.addPointer(event.pointer); - final bloc = context.read(); if (event.kind == PointerDeviceKind.stylus && event.buttons == kPrimaryStylusButton) { cubit.changeTemporaryHandler( diff --git a/fastlane/metadata/android/en-US/changelogs/44.txt b/fastlane/metadata/android/en-US/changelogs/44.txt index 268017bfaa4a..4c1c4230ab63 100644 --- a/fastlane/metadata/android/en-US/changelogs/44.txt +++ b/fastlane/metadata/android/en-US/changelogs/44.txt @@ -1,3 +1,3 @@ * Fix position and size issues when moving elements * Fix gesture issues on area and shape painter and area change problem -* \ No newline at end of file +* Reset pointer on app hide, see #280 \ No newline at end of file