Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
3464cbeb17
commit
318701bb3d
@ -35,6 +35,15 @@ enum FontFamily: String, CaseIterable {
|
||||
}
|
||||
}
|
||||
|
||||
var percentageDownsize: CGFloat {
|
||||
switch self {
|
||||
case .system:
|
||||
return 0.99
|
||||
case .georgia:
|
||||
return 0.90
|
||||
default: return 1
|
||||
}
|
||||
}
|
||||
var fontWeights: [Font.Weight] {
|
||||
guard let weightDict = Self.fontMapWeights[self.rawValue] else {
|
||||
return []
|
||||
|
||||
@ -39,7 +39,7 @@ struct FontUtils {
|
||||
}
|
||||
}
|
||||
|
||||
return low
|
||||
return low * fontName.percentageDownsize
|
||||
}
|
||||
|
||||
static func createFont(
|
||||
|
||||
@ -127,12 +127,9 @@ struct DigitView: View {
|
||||
for: size)
|
||||
|
||||
// Only update if the size is significantly different to prevent micro-adjustments
|
||||
if abs(optimalSize - fontSize) > 0.1 {
|
||||
fontSize = optimalSize
|
||||
}
|
||||
|
||||
fontSize = optimalSize
|
||||
lastCalculatedSize = size
|
||||
|
||||
|
||||
// Reset calculation flag after a brief delay to allow for frame completion
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.016) { // ~60fps
|
||||
isCalculating = false
|
||||
|
||||
Loading…
Reference in New Issue
Block a user