fix: trying to avoid conflict first with tap and pin on plotting screen in progress yet

This commit is contained in:
qguillaume
2026-06-08 23:43:33 +02:00
parent 71ad670ad8
commit 0c509bfdc3

View File

@@ -513,22 +513,24 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
BuildContext context,
AnalysisProvider provider,
) {
// IMPORTANT : on ne met PLUS de Transform (rotation/offset) entre
// l'InteractiveViewer et son contenu.
//
// 1) La rotation est déjà appliquée physiquement dans le fichier par
// cropToSquare (rotationDegrees), donc la ré-appliquer ici est redondant.
// 2) Surtout, un Transform inséré dans le child d'un InteractiveViewer
// fausse le calcul du point focal du pinch : c'était la vraie cause du
// zoom "impossible". On le retire donc complètement.
//
// boundaryMargin est aussi ramené à une valeur finie : une marge infinie
// pousse l'InteractiveViewer à interpréter certains gestes deux-doigts
// comme du déplacement libre au lieu d'un scale.
return InteractiveViewer(
transformationController: _transformationController,
minScale: 1.0,
maxScale: 10.0,
boundaryMargin: const EdgeInsets.all(double.infinity),
boundaryMargin: const EdgeInsets.all(80),
panEnabled: _movingShotId == null,
child: Transform(
transform: Matrix4.identity()
..setTranslationRaw(
widget.cropOffset?.dx ?? 0.0,
widget.cropOffset?.dy ?? 0.0,
0.0,
)
..scale(1.0, 1.0)
..rotateZ((provider.cropRotation) * (math.pi / 180)),
alignment: Alignment.center,
child: GestureDetector(
// AJOUT D'IMPACT : géré ici, sur le GestureDetector parent, par un
// simple tap. Un seul détecteur de tap -> plus de couche concurrente
@@ -678,7 +680,6 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
],
),
),
),
);
}