fix: cadre de centrage au ratio de la photo + bouton calibration Valider

This commit is contained in:
qguillaume
2026-06-16 11:29:08 +02:00
parent 00ae0117c5
commit c4880ccb68
2 changed files with 22 additions and 11 deletions

View File

@@ -101,17 +101,28 @@ class _CropScreenState extends State<CropScreen> {
? const Center(child: CircularProgressIndicator(color: Color(0xFF1A73E8)))
: Column(
children: [
// Zone interactive de crop
// Zone interactive de crop. Le cadre épouse le ratio réel de la photo
// (AspectRatio) → la photo le remplit bord à bord, sans bande noire de
// letterbox. La fenêtre de visée carrée reste centrée à l'intérieur.
Expanded(
child: Container(
margin: const EdgeInsets.all(20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.white10),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: _imageLoaded ? _buildInteractiveCrop() : const Center(child: CircularProgressIndicator()),
child: Padding(
padding: const EdgeInsets.all(20),
child: Center(
child: AspectRatio(
aspectRatio: (_imageSize != null && _imageSize!.height > 0)
? _imageSize!.width / _imageSize!.height
: 1.0,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.white10),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: _imageLoaded ? _buildInteractiveCrop() : const Center(child: CircularProgressIndicator()),
),
),
),
),
),
),