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

Some images were slightly zoomed in (scale of 1.2) on load #3

Open
iori57 opened this issue Nov 28, 2013 · 3 comments
Open

Some images were slightly zoomed in (scale of 1.2) on load #3

iori57 opened this issue Nov 28, 2013 · 3 comments

Comments

@iori57
Copy link

iori57 commented Nov 28, 2013

I wanted it to be of zoom scale 1 on load (so it looks exactly like ImageView) but on some images (depending on width to height ratio) it is zoomed slightly so can't see the whole image until manually zoom out by pinching the image.

I'm still debugging on where the calculation went wrong but haven't got an answer yet. If someone have please let me know thanks!

@iori57
Copy link
Author

iori57 commented Nov 30, 2013

Ignore the scale of 1.2 as I was mistaken. My issue is some images were slightly zoomed in instead of showing the full image on bitmap loaded. I am not sure why but I solved it by commenting out 'zoomTo' inside the overridden setFrame() function.

setImageMatrix(mMatrix);
mMinScale = mScale;
//zoomTo(mScale, mWidth / 2, mHeight / 2);
cutting();
return super.setFrame(l, t, r, b);

What is the purpose of zoomTo? seems to be working fine without it.. and solves my problem.

Hope this helps someone.

And thanks for sharing the code, it is working beautifully!!

@Kaos1337
Copy link

Thank you iori57!

@ataulm
Copy link

ataulm commented May 26, 2014

👍 thanks @iori57 and @matabii

ataulm added a commit to ataulm/mijur that referenced this issue Jan 4, 2015
- extending from MatchParentWidthImageView allows the width to be
match parent, and height as per the aspect ratio
- removing the zoomTo call in setFrame allowed the view to start with an
initial scale as it would have with a regular imageView (or this case the
matchparentwidthimageview) as per
matabii/scale-imageview-android#3
- got rid of the MaxScale check (requires cleaning) to allow unlimited(?)
zoom
- finally added the setImageDrawable override so it works with Picasso
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

3 participants