alexvasilkov / GestureViews

ImageView and FrameLayout with gestures control and position animation
Apache License 2.0
2.38k stars 384 forks source link

Issue when image becomes smaller (when zooming out) than viewport #41

Closed jonathangerbaud closed 7 years ago

jonathangerbaud commented 8 years ago

Hello,

First of all, let me say that your library is amazing!

Now, I'll try to explain the issue precisely. The problem occurs when setRestrictBounds is set to false. When I zoom out and the image becomes smaller than its original size, then gestures (rotation, panning) are almost impossible and seems no longer enabled. Only zooming in seems to work (but not as efficiently as usual behavior).

It's like there is some condition that prevents gesture when the image is smaller than its original size.

And it's quite annoying for user experience.

I tried several combinations of settings but nothing seems to fix this issue.

Here is the actual settings configuration I'm using:

      source.getController().getSettings()
                .setMaxZoom(5f)
                .setPanEnabled(true)
                .setZoomEnabled(true)
                .setDoubleTapEnabled(false)
                .setRotationEnabled(true)
                .setRestrictRotation(false)
                .setRestrictBounds(false)
                .setOverscrollDistance(0f, 0f)
                .setOverzoomFactor(2f)
//                .setFillViewport(true)
                .setFitMethod(Settings.Fit.OUTSIDE)
                .setGravity(Gravity.CENTER);

Maybe I missed a settings, or there is some trick to use to make it work. Any way, if you have any clue, let me know about it.

Thank you in advance for your time!

tdekoning commented 7 years ago

I'm experiencing the same issue with the following configuration:

gestureView.getController()
        .getSettings()
        .setMaxZoom(3f)
        .setRotationEnabled(true)
        .setRestrictBounds(false)
        .setFitMethod(Settings.Fit.INSIDE)
        .setOverscrollDistance(2f, 2f)
alexvasilkov commented 7 years ago

Issue is fixed in d2ad654c648e6899cc455d44ae4d8b4cb2cd8576, will be available in upcoming version.