fermoya / SwiftUIPager

Native Pager in SwiftUI
MIT License
1.29k stars 171 forks source link

[BUG] LoopPages + opacity. First and last element not visible #253

Closed darecki closed 2 years ago

darecki commented 2 years ago

Describe the bug When using the infinite pager (loopPages()) with opacity (.interactive(opacity: xxx)) the first and last elements are not visible.

To Reproduce To reproduce this behavior it's enough to add .interactive(opacity: 0.5) to the InfiniteExampleView example provided.

Expected behavior I expect to see side elements with proper opacity for all elements.

Screenshots / Videos

https://user-images.githubusercontent.com/3084606/159038624-2cd82120-229f-4b98-a74f-0881f9bd7246.mp4

Environment:

Additional context I assume the first and last elements on the list are too far away and the opacity multiplies too much. In reality, in case of the infinite pager, the distance between the first and last element is 1 rather than n-1.

fermoya commented 2 years ago

hi @darecki , thanks for the bug report. This should be fixed here: https://github.com/fermoya/SwiftUIPager/releases/tag/2.3.3-beta.3

darecki commented 2 years ago

Hi @fermoya. I can confirm that the original issue is now solved. Many thanks for that! But, unfortunately, there's a regression. There is a new issue that was not present in version 2.3.2. When slowly dragging you can see that the next element is fading out instead of fading in. And the next element after that is not visible at all. Once the finger is released everything works back again.

Please see the video.

https://user-images.githubusercontent.com/3084606/160378502-fecf771e-1775-4334-bfc1-5c2c4f55220a.mp4

fermoya commented 2 years ago

@darecki thanks for noticing, I totally missed that. Fixed in the new beta