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

Bugfix Precropping issue #71

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

margorski
Copy link

_reCenterImage function now takes into account child widget aspect
ratio when calculating boundaries for offset clamping.

_reCenterImage function now takes into account child widget aspect
ratio when calculating boundaries for offset clamping.
@margorski margorski mentioned this pull request Nov 16, 2021
Rescaling of dimensions needs to be done depending of image orientation.
Previous implementation works correct only for horizontal images.
@xclud
Copy link
Owner

xclud commented Nov 16, 2021

Thank you for the great job.

I am facing one small issue where the cropped image is not pulled back into the view correctly. See the attachment please.

Screenshot 2021-11-16 234124

@margorski
Copy link
Author

Yes. That is intended. I described that in github issue. For our purpose, the current behaviour is intended so that is how it works now. If you would like to have it work like before with limiting the pan to the inside of the picture then the calculation needs to be more complex.

@xclud
Copy link
Owner

xclud commented Nov 17, 2021

It's good to have an option of disabling this behavior. But i think it's best to have it enabled by default. What do you think?

@xclud
Copy link
Owner

xclud commented Nov 17, 2021

Animations also come handy to have as another option.

@margorski
Copy link
Author

Yeah, both animation and that behaviour could be parametrized.
However calculating clamp of pan movement in a previous way may be a little more tricky. Still, I think I may find some time trying to implement that next week.

@xclud
Copy link
Owner

xclud commented Nov 18, 2021

I appreciate your efforts.

@margorski
Copy link
Author

Sorry @xclud but I cannot find the time right now to finish that changes as proposed. Maybe I will have more time to finish that in the new year, but right now changes won't happen. So if you have time to finish that goes on, if not then let's wait.

duytran4 pushed a commit to duytran4/flutter_crop that referenced this pull request Mar 7, 2022
@duytq94
Copy link

duytq94 commented Mar 7, 2022

If we disable rotation like this PR #66 and combine it with this Bugfix Precropping PR, then everything works perfectly.
These PRs will fix the issue and that is the general UX user need (like Instagram at change avatar feature, you can try it)

@eduardohr-muniz
Copy link

eduardohr-muniz commented Jan 25, 2023

This problem has been solved, I use zoom, rotation, and the crop, in my system, but the crop if you slide it to the position you want to crop it comes back by itself, is it some configuration or is it really with the gub, and congratulations by packge!

lukehutch added a commit to lukehutch/flutter_crop that referenced this pull request Feb 28, 2023
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

Successfully merging this pull request may close these issues.

4 participants