diff --git a/TheNoiseClock/Views/Clock/Components/DigitView.swift b/TheNoiseClock/Views/Clock/Components/DigitView.swift index 2666ab2..a7ed7e3 100644 --- a/TheNoiseClock/Views/Clock/Components/DigitView.swift +++ b/TheNoiseClock/Views/Clock/Components/DigitView.swift @@ -17,8 +17,6 @@ struct DigitView: View { let fontFamily: String let fontWeight: String let fontDesign: String - let digitWidth: CGFloat - let digitHeight: CGFloat var body: some View { GeometryReader { geometry in @@ -76,9 +74,7 @@ struct DigitView: View { glowIntensity: 0.2, fontFamily: "System", fontWeight: "Regular", - fontDesign: "Default", - digitWidth: 60, - digitHeight: 100 + fontDesign: "Default" ) return digitView diff --git a/TheNoiseClock/Views/Clock/Components/TimeSegment.swift b/TheNoiseClock/Views/Clock/Components/TimeSegment.swift index a2e1080..72e494a 100644 --- a/TheNoiseClock/Views/Clock/Components/TimeSegment.swift +++ b/TheNoiseClock/Views/Clock/Components/TimeSegment.swift @@ -29,9 +29,7 @@ struct TimeSegment: View { glowIntensity: glowIntensity, fontFamily: fontFamily, fontWeight: fontWeight, - fontDesign: fontDesign, - digitWidth: singleDigitWidth, - digitHeight: singleDigitHeight + fontDesign: fontDesign ) } } @@ -52,27 +50,7 @@ struct TimeSegment: View { ) } - private var singleDigitWidth: CGFloat { - calculateMaxTextWidth(font: customFont, text: "8") - } - private var singleDigitHeight: CGFloat { - calculateMaxTextHeight(font: customFont, text: "8") - } - - // Calculate width of text for the given font - this ensures consistent width - private func calculateMaxTextWidth(font: UIFont, text: String = "8") -> CGFloat { - let attributes = [NSAttributedString.Key.font: font] - let size = (text as NSString).size(withAttributes: attributes) - return size.width - } - - // Calculate height of text for the given font - this ensures consistent height - private func calculateMaxTextHeight(font: UIFont, text: String = "8") -> CGFloat { - let attributes = [NSAttributedString.Key.font: font] - let size = (text as NSString).size(withAttributes: attributes) - return size.height - } } // MARK: - Preview