-
Notifications
You must be signed in to change notification settings - Fork 99
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
On zooming less than min zoom the image is panned to center #21
Comments
Yes, that is the desired behavior. It's a cropper so it tires to pan the image to center. |
Shouldn't the state of view be maintained, it should pan to center of screen not image right, just a suggestion |
@jitheeshsk I don't understand. How can image pan to center of itself? Can you add a gif/video? That would help me understand the problem. |
@jitheeshsk Thanks for the gif. This is indeed a problem. Can you tell me which version of the lib are you using? |
It is 0.1.8 |
@jitheeshsk I'm unable to reproduce it in 0.1.8 with min zoom 0.8f. |
Hi the min zoom is not set, else the image cannot be the completely zoomed
out. Check the min zoom value.
I set min zoom in cropperview.post(). As the minZoomValue is rewritten in
onLayout of cropperImageView.
…On Apr 20, 2017 3:16 PM, "Jay Rambhia" ***@***.***> wrote:
@jitheeshsk <https://github.com/jitheeshsk> I'm unable to reproduce it in
0.1.8 with min zoom 0.8f.
[image: crop_out]
<https://cloud.githubusercontent.com/assets/1256649/25224552/061b8fea-25bf-11e7-8e47-bc36f8ed5440.gif>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGMlV2VS9eaTcKyDZH8B5Ikl4L3XEVlrks5rxymHgaJpZM4NCswI>
.
|
@jitheeshsk oh yes, got the problem. I'll try to fix it. And also |
@jayrambhia I will also see if there is a work around, will try to post if i am able to resolve the issue. Thanks |
in onUp()
Fixed the issue for me |
As mentioned in issue #21, the image pans and snpas back to its own center when zoomed out (> minzoom). This is fixed now. Now, the cropper decides where to snap and pan. If the image is zoomed out such that y translation is > 0, we snap top of the image to the view. If the image is zoomed out such that bottom of the image is inside the view, it snaps to bottom of the view. In other cases, we try to maintain the zoom focus point where it is. The same goes for x dimension. Also fixed image panning issue when scale is min zoom. Issue #10. Apart from these issues, user can set min zoom and it won't be overridden by onLayout method. But this has its own pitfall. If the user changes the image, it is required for the user to change min zoom manually. Signed-off-by: Jay Rambhia <jayrambhia777@gmail.com>
Fixed in 0.1.9. |
Set min zoom to 0.8f.
Take an image which is really long in height, i'm using the below image.
Issue seems to be in on up
private boolean onUp(){
...
if (showAnimation()) {
...
Should solve the issue,
The text was updated successfully, but these errors were encountered: