X Tutup
Skip to content

Commit 3d0ce9b

Browse files
committed
Fix gallery when the recording count is a multiple of 9
1 parent 70a5249 commit 3d0ce9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Assets/Scripts/View/GalleryViewController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void Update() {
254254
int totalNumberOfPages = Math.Max(1, (totalItemCount + numberOfItemsPerPage - 1) / numberOfItemsPerPage);
255255
currentPageIndex = Math.Clamp(currentPageIndex, 0, totalNumberOfPages - 1);
256256

257-
numberOfItemsOnCurrentPage = currentPageIndex == totalNumberOfPages - 1 ? totalItemCount % numberOfItemsPerPage : numberOfItemsPerPage;
257+
numberOfItemsOnCurrentPage = Math.Min(numberOfItemsPerPage, totalItemCount - currentPageIndex * numberOfItemsPerPage);
258258

259259
if (loadedScenes.Length != galleryManager.gallery.entries.Count) {
260260
Array.Resize(ref loadedScenes, galleryManager.gallery.entries.Count);

0 commit comments

Comments
 (0)
X Tutup