fix: opacity 80% for impacts + lower quality for pics + removing slowly zoom if you back go back

This commit is contained in:
qguillaume
2026-06-08 22:00:34 +02:00
parent f0b15941cf
commit 9afe3c8508
4 changed files with 92 additions and 14 deletions

View File

@@ -151,6 +151,19 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
}
}
/// Repasse en mode calibration en réinitialisant le zoom de l'InteractiveViewer.
///
/// Sans cette remise à zéro, le facteur de zoom accumulé en mode Plotting
/// persiste dans le TransformationController et se réapplique au retour,
/// ce qui faisait "zoomer" légèrement la photo à chaque aller-retour
/// Plotting <-> Centrage. On repart donc toujours d'une transformation
/// identité (zoom 1.0).
void _enterCalibration() {
_transformationController.value = Matrix4.identity();
_currentZoomScale = 1.0;
setState(() => _isCalibrating = true);
}
@override
Widget build(BuildContext context) {
final provider = context.watch<AnalysisProvider>();
@@ -184,7 +197,8 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
),
);
} else {
setState(() => _isCalibrating = true);
// Retour Plotting -> Calibration : on réinitialise le zoom.
_enterCalibration();
}
},
),
@@ -199,7 +213,16 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
),
if (_isCalibrating)
TextButton(
onPressed: () => setState(() => _isCalibrating = false),
onPressed: () {
// On fige la calibration courante dans le provider AVANT de
// basculer en Plotting, pour que l'instance Plotting parte
// d'un état figé et indépendant des rebuilds de calibration.
_calibrationKey.currentState?.commitCalibration();
setState(() {
_isCalibrating = false;
_isSelectingReferences = false;
});
},
child: const Text(
'TERMINER',
style: TextStyle(
@@ -316,7 +339,8 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
Icons.arrow_forward_ios,
size: 16,
),
onTap: () => setState(() => _isCalibrating = true),
// Retour vers la calibration : on réinitialise le zoom.
onTap: () => _enterCalibration(),
),
),
const SizedBox(height: 12),