Skip to content

Commit

Permalink
Remove cycle scrolling for screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
Neakita committed Sep 25, 2023
1 parent 7f357b7 commit 34ab4d8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using DynamicData.Binding;
using ReactiveUI;
using SightKeeper.Application.Annotating;
using SightKeeper.Commons;
using SightKeeper.Domain.Model;
using SightKeeper.Domain.Services;

Expand Down Expand Up @@ -106,7 +105,9 @@ public void ScrollScreenshot(bool reverse)
{
if (Screenshots.Count <= 1 || SelectedScreenshotViewModel.SelectedScreenshotIndex == null)
return;
SelectedScreenshotViewModel.SelectedScreenshotIndex = SelectedScreenshotViewModel.SelectedScreenshotIndex.Value.Cycle(0, Screenshots.Count - 1, reverse);
var indexDelta = reverse ? -1 : 1;
var newIndex = SelectedScreenshotViewModel.SelectedScreenshotIndex.Value + indexDelta;
SelectedScreenshotViewModel.SelectedScreenshotIndex = Math.Clamp(newIndex, 0, Screenshots.Count - 1);
}

private readonly ScreenshotsDataAccess _screenshotsDataAccess;
Expand Down

0 comments on commit 34ab4d8

Please sign in to comment.