Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added disableRotation property #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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