implementation de cunning pour scanner l'image et la redresser
This commit is contained in:
@@ -119,7 +119,8 @@ class _CropScreenState extends State<CropScreen> {
|
||||
_viewportSize = Size(constraints.maxWidth, constraints.maxHeight);
|
||||
|
||||
// Taille du carré de crop (90% de la plus petite dimension)
|
||||
_cropSize = math.min(constraints.maxWidth, constraints.maxHeight) * 0.85;
|
||||
_cropSize =
|
||||
math.min(constraints.maxWidth, constraints.maxHeight) * 0.85;
|
||||
|
||||
// Calculer l'échelle initiale si pas encore fait
|
||||
if (_scale == 1.0 && _offset == Offset.zero) {
|
||||
@@ -138,7 +139,7 @@ class _CropScreenState extends State<CropScreen> {
|
||||
child: Transform(
|
||||
transform: Matrix4.identity()
|
||||
..setTranslationRaw(_offset.dx, _offset.dy, 0)
|
||||
..scale(_scale, _scale, 1.0),
|
||||
..scale(_scale, _scale),
|
||||
alignment: Alignment.center,
|
||||
child: Image.file(
|
||||
File(widget.imagePath),
|
||||
@@ -153,10 +154,7 @@ class _CropScreenState extends State<CropScreen> {
|
||||
// Overlay de recadrage
|
||||
Positioned.fill(
|
||||
child: IgnorePointer(
|
||||
child: CropOverlay(
|
||||
cropSize: _cropSize,
|
||||
showGrid: true,
|
||||
),
|
||||
child: CropOverlay(cropSize: _cropSize, showGrid: true),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user