Remove some commented-out code in ThumbnailImage
- ID
69ceba3- date
2023-06-11 20:01:07+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
d6cc5e9- message
Remove some commented-out code in ThumbnailImage- changed files
1 file, 9 additions, 17 deletions
Changed files
BlinkReviewer/Blink/Views/Thumbnails/ThumbnailImage.swift (1979) → BlinkReviewer/Blink/Views/Thumbnails/ThumbnailImage.swift (1601)
diff --git a/BlinkReviewer/Blink/Views/Thumbnails/ThumbnailImage.swift b/BlinkReviewer/Blink/Views/Thumbnails/ThumbnailImage.swift
index ce45de1..e968d7e 100644
--- a/BlinkReviewer/Blink/Views/Thumbnails/ThumbnailImage.swift
+++ b/BlinkReviewer/Blink/Views/Thumbnails/ThumbnailImage.swift
@@ -7,6 +7,15 @@ import Photos
/// mean some information gets cropped out -- that's okay, these are only
/// small previews, not complete images.
struct ThumbnailImage: View {
+
+ // Implementation note: the reason we pass in a bunch of individual
+ // properties rather than the whole asset is because we need an
+ // @EnvironmentObject (the PhotosLibrary) to create the PHAssetImage,
+ // so we can stick the latter in an @ObservedObject.
+ //
+ // But EnvironmentObject values aren't passed down until you call the
+ // `body` method, which is too late! So instead we have the parent
+ // view call into PhotosLibrary and pass in the relevant values here.
@ObservedObject var assetImage: PHAssetImage
var state: ReviewState?
var isFocused: Bool
@@ -19,23 +28,6 @@ struct ThumbnailImage: View {
private func cornerRadius() -> CGFloat {
isFocused ? 7 : 5
}
-
- // Implementation note: the reason we pass in a bunch of individual
- // properties rather than the whole asset is because we need an
- // @EnvironmentObject (the PhotosLibrary) to create the PHAssetImage,
- // so we can stick the latter in an @ObservedObject.
- //
- // But EnvironmentObject values aren't passed down until you call the
- // `body` method, which is too late! So instead we have the parent
- // view call into PhotosLibrary and pass in the relevant values here.
-// init(_ assetImage: PHAssetImage, state: ReviewState?, isFavorite: Bool, isFocused: Bool) {
-// print("Redrawing thumbnail image! \(assetImage.asset?.localIdentifier ?? "(unknown)") @ \(DispatchTime.now())")
-//
-// self.assetImage = assetImage
-// self.state = state
-// self.isFavorite = isFavorite
-// self.isFocused = isFocused
-// }
var body: some View {
Image(nsImage: assetImage.image)