Skip to content

Commit

Permalink
fix the size of the dots in the gallery
Browse files Browse the repository at this point in the history
oops! I broke the size in #1691
  • Loading branch information
joshuatbrown committed Nov 27, 2024
1 parent 0dfd5f3 commit f4f2dc8
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions Nos/Views/Components/Media/GalleryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,29 +187,16 @@ fileprivate struct GalleryIndexView: View {
/// - Parameter index: The index of the page to evaluate.
/// - Returns: A scale factor based on the distance from `currentIndex`.
private func scaleFor(_ index: Int) -> CGFloat {
// Show all circles at full size if there are 6 or fewer pages
if numberOfPages <= maxNumberOfCircles {
return 1.0
}

if index == currentIndex {
return 1.0
}
if displayRange.lowerBound > 0 {
if index == displayRange.lowerBound {
return 0.5
} else if index == displayRange.lowerBound + 1 {
return 0.75
}
if displayRange.lowerBound > 0 && index == displayRange.lowerBound {
return 0.5
}
if displayRange.upperBound < numberOfPages - 1 {
if index == displayRange.upperBound {
return 0.5
} else if index == displayRange.upperBound - 1 {
return 0.75
}
if displayRange.upperBound < numberOfPages - 1 && index == displayRange.upperBound {
return 0.5
}
return 1.0
return 0.75
}
}

Expand Down

0 comments on commit f4f2dc8

Please sign in to comment.