From f4f2dc836e6c00b814ec7b66b7db630faf6e655d Mon Sep 17 00:00:00 2001 From: Josh Brown Date: Wed, 27 Nov 2024 14:16:27 -0500 Subject: [PATCH] fix the size of the dots in the gallery oops! I broke the size in #1691 --- Nos/Views/Components/Media/GalleryView.swift | 23 +++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/Nos/Views/Components/Media/GalleryView.swift b/Nos/Views/Components/Media/GalleryView.swift index 076328423..4ac7d5226 100644 --- a/Nos/Views/Components/Media/GalleryView.swift +++ b/Nos/Views/Components/Media/GalleryView.swift @@ -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 } }