fix(calibration): application du crop sur l'écran de calibration
This commit is contained in:
@@ -215,10 +215,57 @@ class _AnalysisScreenContentState extends State<_AnalysisScreenContent> {
|
||||
? Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
Image.file(
|
||||
File(provider.imagePath!),
|
||||
fit: BoxFit.fill,
|
||||
// 1. L'IMAGE ZOOME ET RECADRE
|
||||
ClipRect(
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
const double _currentRotation = 0.0;
|
||||
|
||||
return Transform(
|
||||
transform: Matrix4.identity()
|
||||
..translate(widget.cropOffset?.dx ?? 0.0, widget.cropOffset?.dy ?? 0.0)
|
||||
..scale(widget.cropScale ?? 1.0, widget.cropScale ?? 1.0),
|
||||
alignment: Alignment.center,
|
||||
child: Image.file(
|
||||
File(provider.imagePath!),
|
||||
fit: BoxFit.contain, // Respecte la géométrie du CropScreen
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
|
||||
// 2. LE MASQUE OPAQUE (Cache tout ce qui dépasse pour simuler le Crop parfait)
|
||||
Positioned.fill(
|
||||
child: IgnorePointer(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
// On recalcule la taille du carré de calibration (95% du plus petit côté, comme l'écran d'avant)
|
||||
final double cropSize = math.min(constraints.maxWidth, constraints.maxHeight) * 0.95;
|
||||
|
||||
return ColorFiltered(
|
||||
colorFilter: const ColorFilter.mode(
|
||||
Color(0xFF101214), // La couleur sombre de ton fond d'écran
|
||||
BlendMode.srcOut,
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
width: cropSize,
|
||||
height: cropSize,
|
||||
color: Colors.black, // Fenêtre visible carrée aux coins droits
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// 3. LA CIBLE ROUGE DE CALIBRATION (Reste au-dessus, parfaitement accessible)
|
||||
TargetCalibration(
|
||||
key: _calibrationKey,
|
||||
initialCenterX: provider.targetCenterX,
|
||||
|
||||
Reference in New Issue
Block a user