From 622f2936dedb4add7987ce0e181f0675792ab168 Mon Sep 17 00:00:00 2001 From: qguillaume Date: Tue, 26 May 2026 23:23:45 +0200 Subject: [PATCH] =?UTF-8?q?ui(plotting):=20d=C3=A9calage=20visuel=20de=20l?= =?UTF-8?q?'impact=20lors=20du=20glisser=20pour=20=C3=A9viter=20de=20le=20?= =?UTF-8?q?cacher=20avec=20le=20doigt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/features/analysis/analysis_screen.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/features/analysis/analysis_screen.dart b/lib/features/analysis/analysis_screen.dart index 99aeb056..f97d142a 100644 --- a/lib/features/analysis/analysis_screen.dart +++ b/lib/features/analysis/analysis_screen.dart @@ -507,14 +507,19 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> { } }, - // 3. GLISSER : On déplace l'impact verrouillé en temps réel sous le doigt + // 3. GLISSER : On déplace l'impact verrouillé en temps réel avec un décalage visuel onLongPressMoveUpdate: (LongPressMoveUpdateDetails details) { if (_movingShotId == null) return; final RenderBox? box = _imageKey.currentContext?.findRenderObject() as RenderBox?; if (box == null) return; - final localOffset = box.globalToLocal(details.globalPosition); + // CORRECTION : On applique un décalage de pixels (Offset) vers le haut et la gauche + // -25 pixels sur l'axe X (vers la gauche) et -35 pixels sur l'axe Y (vers le haut) + // pour que l'impact sorte de dessous la pulpe du doigt ! + final adjustedGlobalPosition = details.globalPosition + const Offset(-25, -35); + + final localOffset = box.globalToLocal(adjustedGlobalPosition); // Calcul des coordonnées relatives bridées entre 0.0 et 1.0 (pour pas sortir de la photo) final relX = (localOffset.dx / box.size.width).clamp(0.0, 1.0);