Describe the bug
When opening a folder with at least 2 pictures in it, using the left arrow navigation (keyboard arrow or the arrow in the GUI) will not load the first image in the folder after going to any image that is NOT the first image. No error or crash happens; just no action takes place.
IF looping is enabled, however, it works as expected.
To Reproduce
Steps to reproduce the behavior:
Load a folder with at least 2 pictures in it with the app.
The app will successfully load and display the first image in the folder.
Use the right navigation arrows to go to the right just one picture.
After the next image has loaded, attempt to use the navigations button to go back to the first image again.
Expected behavior
The first image in the folder should be loaded and displayed.
Additional context
The problem comes from the logic in Navigation.cs around lines 95 and 96:
When the first image in a folder is the target destination, newIndex will be calculated to be 0. Because of the if logic on line 96, when newIndex is less than or equal to 0, the operation will be cancelled.
I think it should be okay to change the comparison to a "less than" instead, but I saw your note about the UI blink so not sure if it's as simple as that.
Thanks for pointing it out. The note is old and the newer code/newer version of .NET changed it so it no longer applies. It will be fixed in the new version soon.
Describe the bug When opening a folder with at least 2 pictures in it, using the left arrow navigation (keyboard arrow or the arrow in the GUI) will not load the first image in the folder after going to any image that is NOT the first image. No error or crash happens; just no action takes place.
IF looping is enabled, however, it works as expected.
To Reproduce Steps to reproduce the behavior:
Expected behavior The first image in the folder should be loaded and displayed.
Additional context The problem comes from the logic in Navigation.cs around lines 95 and 96:
https://github.com/Ruben2776/PicView/blob/53e18f6952e4e9131e552ebc85e3c82409782eb9/PicView/ChangeImage/Navigation.cs#L96
When the first image in a folder is the target destination,
newIndex
will be calculated to be0
. Because of the if logic on line 96, whennewIndex
is less than or equal to 0, the operation will be cancelled.I think it should be okay to change the comparison to a "less than" instead, but I saw your note about the UI blink so not sure if it's as simple as that.
Cheers.