Skip to content

Commit d29efcd

Browse files
committed
feat(Clock): Drawing hours Text are now proportional of the Clock size
1 parent 7ad8b18 commit d29efcd

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Works with Xcode 11.
1414

1515
* ✅ Deploy on real iOS device
1616
* ✅ Add an icon
17-
* 🛠 Improve UI for iPad format
17+
* Improve UI for iPad format

telltime/Clock/Elements/Indicators/DrawnIndicators.swift

+2
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,15 @@ struct DrawnNumbers: View {
164164
private static let hours = [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
165165
private static let limitedHours = [12, 3, 6, 9]
166166
private static let marginRatio: CGFloat = 1/7
167+
private static let fontSizeRatio: CGFloat = 1/10
167168
let isHourIndicatorsShown: Bool
168169
let isMinuteIndicatorsShown: Bool
169170
let isLimitedHoursShown: Bool
170171

171172
var body: some View {
172173
ForEach(self.configurationHours, id: \.self) { hour in
173174
Text("\(hour)")
175+
.modifier(FontProportional(ratio: Self.fontSizeRatio))
174176
.rotationEffect(Current.clock.randomAngle() ?? .zero, anchor: .center)
175177
.scaleEffect(Current.clock.randomScale() ?? 1, anchor: .center)
176178
.modifier(PositionInCircle(
Loading

0 commit comments

Comments
 (0)