Skip to content

Commit

Permalink
More Image Control Bugfix (#1637)
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBAndrews authored Jan 20, 2025
1 parent 4460483 commit 697e7f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 5 additions & 3 deletions Mlem/App/Views/Pages/ImageViewer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)!
Expand Down Expand Up @@ -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)
}

Expand Down
3 changes: 0 additions & 3 deletions Mlem/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -1742,9 +1742,6 @@
},
"Reset" : {

},
"Reset Settings State" : {

},
"Resolve" : {

Expand Down

0 comments on commit 697e7f5

Please sign in to comment.