bluefireteam / photo_view

📸 Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.
MIT License
1.88k stars 540 forks source link

[BUG] Unable to view the next picture #383

Open wh19990906 opened 3 years ago

wh19990906 commented 3 years ago

initialScale: PhotoViewComputedScale.contained * 0.8

When I set the initialScale, when I view the picture for the first time, I can’t slide to the next picture. The sliding area is very small. Only a little bit on the four sides of the picture can slide successfully, but when I slide to the next picture successfully After that the problem disappeared

wh19990906 commented 3 years ago

My problem is caused by initialScale, remove it

PhotoViewGalleryPageOptions( imageProvider: AssetImage("images/pavlova.jpg"), // initialScale: PhotoViewComputedScale.contained, minScale: PhotoViewComputedScale.contained (0.5 + index / 10), maxScale: PhotoViewComputedScale.covered 4.1, heroAttributes: PhotoViewHeroAttributes(tag: item.id), )

At 2021-01-20 17:26:17, "lan2000" notifications@github.com wrote:

I also encountered the same problem. Only occasionally can I slide the picture at the border of the screen. How to solve it, thank you.

PhotoViewGalleryPageOptions( imageProvider: AssetImage("images/pavlova.jpg"), initialScale: PhotoViewComputedScale.contained, minScale: PhotoViewComputedScale.contained (0.5 + index / 10), maxScale: PhotoViewComputedScale.covered 4.1, heroAttributes: PhotoViewHeroAttributes(tag: item.id), )

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

manafire commented 3 years ago

I don't know if it's related but in my case I also noticed that when initialScale and minScale were both set to PhotoViewComputedScale.contained I have to swipe twice in the same direction for the gesture to take; the first swipe is ignored. If I try to swipe in alternating opposite directions nothing happens. However, if I swipe fast (before the image "settles") it works fine.

As a workaround, I multiplied PhotoViewComputedScale.contained * 0.99 to fix it. I never would've figured that out without this issue report, so thanks for that!