Skip to content

Commit b0bc2b9

Browse files
Merge branch 'main' into upgrade_flutter_dependencies
2 parents 06e4517 + 0533435 commit b0bc2b9

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

integration_test/app_test.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,23 @@ Future<void> main() async {
101101

102102
// copy local info
103103
await tester.sendKeyDownEvent(LogicalKeyboardKey.control);
104-
await tester.sendKeyEvent(CopyLocalInfoShortcut.logicalKey);
104+
await tester.sendKeyDownEvent(CopyLocalInfoShortcut.logicalKey);
105+
await tester.sendKeyUpEvent(CopyLocalInfoShortcut.logicalKey);
105106
await tester.sendKeyUpEvent(LogicalKeyboardKey.control);
106107
await tester.pumpAndSettle();
107108

108109
// copy board image
109110
await tester.sendKeyDownEvent(LogicalKeyboardKey.control);
110-
await tester.sendKeyEvent(CaptureBoardImageShortcut.logicalKey);
111+
await tester.sendKeyDownEvent(CaptureBoardImageShortcut.logicalKey);
112+
await tester.sendKeyUpEvent(CaptureBoardImageShortcut.logicalKey);
111113
await tester.sendKeyUpEvent(LogicalKeyboardKey.control);
112114
await tester.pumpAndSettle();
113115
await Future<void>.delayed(const Duration(seconds: 1));
114116

115117
// copy moves
116118
await tester.sendKeyDownEvent(LogicalKeyboardKey.control);
117-
await tester.sendKeyEvent(CopyMovesShortcut.logicalKey);
119+
await tester.sendKeyDownEvent(CopyMovesShortcut.logicalKey);
120+
await tester.sendKeyUpEvent(CopyMovesShortcut.logicalKey);
118121
await tester.sendKeyUpEvent(LogicalKeyboardKey.control);
119122
await tester.pumpAndSettle();
120123
final clipboardDataMoves = await Clipboard.getData(Clipboard.kTextPlain);

lib/board/pedax_shortcuts/capture_board_image_shortcut.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ class CaptureBoardImageShortcut implements PedaxShortcut {
3838
final pngByteData = await image.toByteData(format: ui.ImageByteFormat.png);
3939
final pngBytes = pngByteData!.buffer.asUint8List();
4040

41-
final file = File('${(await _tmpDir).path}/board_for_clipboard.png');
41+
final tmpDir = await _tmpDir;
42+
if (!tmpDir.existsSync()) await tmpDir.create(recursive: true);
43+
44+
final file = File('${tmpDir.path}/board_for_clipboard.png');
4245
await file.writeAsBytes(pngBytes);
4346
await Pasteboard.writeFiles([file.path]);
4447
}

0 commit comments

Comments
 (0)