sephiroth74 / ImageViewZoom

Android ImageView widget with zoom and pan capabilities
Other
1.9k stars 533 forks source link

Fix #canScroll when image.width < view.width #90

Open ghost opened 8 years ago

ghost commented 8 years ago

This fixes a bug in the #canScroll method where it always returns true (instead of false), when the width of the bitmap is smaller than the width of the ImageViewTouch.

It can be reproduced by creating a ViewPager containing a ImageViewTouch and loading an image that is smaller than the resulting width of the ImageViewTouch.

Here is an example (not mine): https://gist.github.com/atermenji/3781644

ghost commented 8 years ago

This is a workaround I'm using in my app: https://github.com/tjg1/nori/blob/573c63006362ea1c310ade93e2752724efced22c/app/src/main/java/com/cuddlesoft/nori/fragment/PicassoImageFragment.java#L58