Fix artwork selection

This commit is contained in:
Damiano Galassi committed 2018-06-28 15:55:31 +02:00
1 parent 5e58a9f03b
commit 8f09c5b325
1 file changed
+2 -2
+2 -2
View File
@@ -385,7 +385,7 @@ class ArtworkSelectorController: NSWindowController, NSCollectionViewDataSource,
} }
private func selectArtwork(at index: Int) { private func selectArtwork(at index: Int) {
let indexPath = IndexPath(item: 0, section: 0) let indexPath = IndexPath(item: index, section: 0)
imageBrowser.selectItems(at: [indexPath], scrollPosition: .top) imageBrowser.selectItems(at: [indexPath], scrollPosition: .top)
addArtworkButton.isEnabled = imageBrowser.selectionIndexPaths.isEmpty == false addArtworkButton.isEnabled = imageBrowser.selectionIndexPaths.isEmpty == false
} }
@@ -426,7 +426,7 @@ class ArtworkSelectorController: NSWindowController, NSCollectionViewDataSource,
} }
private func selectedArtworks() -> [ArtworkImageObject] { private func selectedArtworks() -> [ArtworkImageObject] {
return imageBrowser.selectionIndexes.map { artworks[$0] } return imageBrowser.selectionIndexPaths.map { artworks[$0.item] }
} }
// MARK: - Finishing Up // MARK: - Finishing Up