fix(crop): stabiliser le rectangle géométrique de découpe et l'enchaînement des zooms

This commit is contained in:
qguillaume
2026-05-27 15:36:56 +02:00
parent 4d2ca2c94f
commit 730629a031
5 changed files with 269 additions and 174 deletions

View File

@@ -162,8 +162,8 @@ class AnalysisProvider extends ChangeNotifier {
return;
}
// Detect target and impacts
final result = _detectionService.detectTarget(imagePath, targetType);
// CORRECTION PARALLÈLE : Changement de la méthode pour l'Isolate asynchrone
final result = await _detectionService.detectTargetAsync(imagePath, targetType);
if (!result.success) {
_state = AnalysisState.error;

View File

@@ -225,8 +225,8 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
return Transform(
transform: Matrix4.identity()
..setTranslationRaw(widget.cropOffset?.dx ?? 0.0, widget.cropOffset?.dy ?? 0.0, 0.0)
..scale(1.0, 1.0) // Zoom ignoré au plotting pour rester en vue globale
..rotateZ((provider.cropRotation) * (math.pi / 180)), // FIX : Utilisation du provider dynamique
..scale(1.0, 1.0)
..rotateZ((provider.cropRotation) * (math.pi / 180)),
alignment: Alignment.center,
child: Image.file(
File(provider.imagePath!),