Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mobile][photos] Release the corner handle when its touch is cancelled

r4khul8ea5f95b44d4
diff --git a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_layer_selection.dart b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_layer_selection.dart
index b78c9bd020..f78b10756f 100644
--- a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_layer_selection.dart
+++ b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_layer_selection.dart
@@ -405,6 +405,7 @@ class _LayerSelection extends StatelessWidget {
behavior: HitTestBehavior.translucent,
onPointerDown: onScaleRotateDown,
onPointerUp: onScaleRotateEnd,
+ onPointerCancel: onScaleRotateEnd,
child: const IgnorePointer(child: SizedBox.expand()),
),
),
diff --git a/mobile/apps/photos/test/ui/tools/editor/image_editor_text_test.dart b/mobile/apps/photos/test/ui/tools/editor/image_editor_text_test.dart
index 7368358567..da8b16cb67 100644
--- a/mobile/apps/photos/test/ui/tools/editor/image_editor_text_test.dart
+++ b/mobile/apps/photos/test/ui/tools/editor/image_editor_text_test.dart
@@ -236,6 +236,27 @@ void main() {
);
}
+ testWidgets('a cancelled corner touch stops rotating and scaling', (
+ tester,
+ ) async {
+ final editor = await _openEditor(tester);
+ await _tap(tester, find.text('Done'));
+ final rect = tester.getRect(
+ find.byKey(editor.activeLayers.single.keyInternalSize),
+ );
+ final gesture = await tester.startGesture(
+ rect.topRight + const Offset(6, -6),
+ );
+ expect(
+ editor.layerInteractionManager.rotateScaleLayerSizeHelper,
+ isNotNull,
+ );
+ await gesture.cancel();
+ await tester.pumpAndSettle();
+
+ expect(editor.layerInteractionManager.rotateScaleLayerSizeHelper, isNull);
+ });
+
testWidgets('typed text remains visible after rotating to landscape', (
tester,
) async {