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

image is zoomed a lot when interactive is true. #106

Open
0xManjeet opened this issue Jun 17, 2023 · 3 comments
Open

image is zoomed a lot when interactive is true. #106

0xManjeet opened this issue Jun 17, 2023 · 3 comments

Comments

@0xManjeet
Copy link

0xManjeet commented Jun 17, 2023

Same as this issue: #70

code:

Crop(
        image: bytes,
        withCircleUi: true,
        interactive: true,
        controller: _controller,
        onCropped: (image) {
         
        },
      )
 crop_your_image: ^0.7.5
@0xManjeet 0xManjeet changed the title image is zoomed a lot when interactive is true. same as https://github.com/chooyan-eng/crop_your_image/issues/70 image is zoomed a lot when interactive is true. Jun 17, 2023
0xManjeet added a commit to 0xManjeet/crop_your_image that referenced this issue Jun 18, 2023
@chooyan-eng
Copy link
Owner

chooyan-eng commented Jun 30, 2023

@0xManjeet
Thank you for your feedback.

How do you think of adding fit parameter to Crop() such like Image widget does?
You can pass BoxFit.contain to avoid initial zooming.

@hedi-ghodhbane
Copy link

@chooyan-eng This would make sense in my case. As this scale is causing issues with my OCR. I need an option to keep the image interactive so when I rotate the image I can still drag it, while also having the option to make it contained.

@litang0908
Copy link

same problem, but you can change the willUpdateScale method and return false at the first time.

 bool _isInitScale = true;

/// only the first time can not scale
willUpdateScale: (scale) {
                  if (_isInitScale) {
                    _isInitScale = false;
                    return false;
                  }
                  _isInitScale = false;
                  return true;
                },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants