fix the issue that the last image is missing in media detail screen

This commit is contained in:
ryanzhao 2021-06-04 15:59:59 +10:00
parent ae4e781055
commit 77008443d4
1 changed files with 2 additions and 2 deletions

View File

@ -630,7 +630,7 @@ class MediaGallery: NSObject, MediaGalleryDataSource, MediaTileViewControllerDel
// To keep it simple, this isn't exactly *amount* sized if `message` window overlaps the end or
// beginning of the view. Still, we have sufficient buffer to fetch more as the user swipes.
let start: Int = initialIndex - Int(amount) / 2
let end: Int = initialIndex + Int(amount) / 2
let end: Int = initialIndex + Int(amount) / 2 + 1
return start..<end
case .before:
@ -640,7 +640,7 @@ class MediaGallery: NSObject, MediaGalleryDataSource, MediaTileViewControllerDel
return start..<end
case .after:
let start: Int = initialIndex
let end: Int = initialIndex + Int(amount)
let end: Int = initialIndex + Int(amount) + 1
return start..<end
}