Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/src/crop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Crop extends StatefulWidget {
final BoxShape shape;
final ValueChanged<MatrixDecomposition>? onChanged;
final Duration animationDuration;
final bool disableRotation;

Crop({
Key? key,
Expand All @@ -38,6 +39,7 @@ class Crop extends StatefulWidget {
this.shape: BoxShape.rectangle,
this.onChanged,
this.animationDuration = const Duration(milliseconds: 200),
this.disableRotation = false,
}) : super(key: key);

@override
Expand Down Expand Up @@ -196,7 +198,7 @@ class _CropState extends State<Crop> with TickerProviderStateMixin {

// In the case where lesser than 2 fingers involved in scaling, we ignore
// the rotation handling.
if (details.pointerCount > 1) {
if (details.pointerCount > 1 && !widget.disableRotation) {
// In the first touch, we reset all the values.
if (_previousPointerCount != details.pointerCount) {
_previousPointerCount = details.pointerCount;
Expand Down