From 697e7f5daa612b2836cdf24a4526e2c6ef9e6eba Mon Sep 17 00:00:00 2001 From: Eric Andrews Date: Mon, 20 Jan 2025 14:35:09 -0500 Subject: [PATCH] More Image Control Bugfix (#1637) --- Mlem/App/Views/Pages/ImageViewer.swift | 8 +++++--- Mlem/Localizable.xcstrings | 3 --- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Mlem/App/Views/Pages/ImageViewer.swift b/Mlem/App/Views/Pages/ImageViewer.swift index edb2ef46e..d796aada3 100644 --- a/Mlem/App/Views/Pages/ImageViewer.swift +++ b/Mlem/App/Views/Pages/ImageViewer.swift @@ -44,7 +44,7 @@ struct ImageViewer: View { @State var quickLookUrl: URL? // Whether the controls are currently visible - var controlsShown: Bool { controlOpacity == 1 } + var controlsShown: Bool { controlOpacity > 0 } init(url: URL) { var components = URLComponents(url: url, resolvingAgainstBaseURL: false)! @@ -183,8 +183,10 @@ struct ImageViewer: View { private func handleOffsetUpdate(_ newOffset: CGFloat) { let absOffset = abs(newOffset) offset = newOffset - controlOffset = absOffset / 3 - controlOpacity = 1.0 - (controlOffset / maxControlOffset) + if controlsShown { + controlOffset = absOffset / 3 + controlOpacity = 1.0 - (controlOffset / maxControlOffset) + } opacity = 1.0 - (absOffset / screenHeight) } diff --git a/Mlem/Localizable.xcstrings b/Mlem/Localizable.xcstrings index a51233efd..3e1128f4a 100644 --- a/Mlem/Localizable.xcstrings +++ b/Mlem/Localizable.xcstrings @@ -1742,9 +1742,6 @@ }, "Reset" : { - }, - "Reset Settings State" : { - }, "Resolve" : {