feat: horizontal flip with R key, baked into crop save (v1.6.0)

- R mirrors the view about the viewport centre and clears the active effects
  (same reset as double right click); pressing R again restores the original
  orientation. Pan/zoom are kept.
- Image switch, fill/fit toggle and right double click also clear the flip.
- Crop save (Ctrl+S) mirrors the output too, so the saved JPEG matches the
  on-screen view (verified in combination with rotation).
- Shortcut lists (tr/en), README and CHANGELOG updated; deb rebuilt as 1.6.0.
This commit is contained in:
Alhan committed 2026-10-14 02:28:24 +03:00
1 parent 24cab6f908
commit bad48167c8
14 files changed
+130 -10

No files matched your search

+32
View File
@@ -67,6 +67,38 @@ Future<void> main() async {
print('3) dims ${r3.width}x${r3.height} (25x25 beklenir: zoom x2 + fill k=2 -> 4 src px/ekran px)');
if (r3.width != 25 || r3.height != 25) fails++;
// 4) Yatay aynalama (flipH): gorunum aynalanir, cikti da aynali olmali
final out4 = '${tmp.path}/d';
Directory(out4).createSync();
final f4 = '$out4/src.jpg';
File(f4).writeAsBytesSync(File(srcPath).readAsBytesSync());
final p4 = CropViewParams(w: 100, h: 50, vw: 100, vh: 50, tx: 0, ty: 0, sc: 1,
angleDeg: 0, flipH: true, cx: 50, cy: 25, k: 1, ox: 0, oy: 0);
final path4 = await CropSaveService.saveCrop(srcPath: f4, source: await CropSaveService.load(f4), vp: p4);
final r4 = img.decodeImage(File(path4).readAsBytesSync())!;
print('4) dims ${r4.width}x${r4.height} (100x50 beklenir)');
if (r4.width != 100 || r4.height != 50) fails++;
checkPix('4) sol-ust (orij sag-ust YESIL)', imgPx(r4, 2, 2), 0, 255, 0);
checkPix('4) sag-ust (orij sol-ust KIRMIZI)', imgPx(r4, 97, 2), 255, 0, 0);
checkPix('4) sol-alt (orij sag-alt SARI)', imgPx(r4, 2, 47), 255, 255, 0);
checkPix('4) sag-alt (orij sol-alt MAVI)', imgPx(r4, 97, 47), 0, 0, 255);
// 5) Donus + aynalama: 2. senaryonun aynasi
final out5 = '${tmp.path}/e';
Directory(out5).createSync();
final f5 = '$out5/src.jpg';
File(f5).writeAsBytesSync(File(srcPath).readAsBytesSync());
final p5 = CropViewParams(w: 100, h: 50, vw: 50, vh: 100, tx: 0, ty: 0, sc: 1,
angleDeg: 90, flipH: true, cx: 25, cy: 50, k: 1, ox: -25, oy: 25);
final path5 = await CropSaveService.saveCrop(srcPath: f5, source: await CropSaveService.load(f5), vp: p5);
final r5 = img.decodeImage(File(path5).readAsBytesSync())!;
print('5) dims ${r5.width}x${r5.height} (50x100 beklenir)');
if (r5.width != 50 || r5.height != 100) fails++;
checkPix('5) sol-ust (orij sol-ust KIRMIZI)', imgPx(r5, 2, 2), 255, 0, 0);
checkPix('5) sag-ust (orij sol-alt MAVI)', imgPx(r5, 47, 2), 0, 0, 255);
checkPix('5) sol-alt (orij sag-ust YESIL)', imgPx(r5, 2, 97), 0, 255, 0);
checkPix('5) sag-alt (orij sag-alt SARI)', imgPx(r5, 47, 97), 255, 255, 0);
tmp.deleteSync(recursive: true);
print(fails == 0 ? 'ALL PASS' : '$fails FAILURES');
exitCode = fails == 0 ? 0 : 1;