Skip to content

Commit 717ce0d

Browse files
authored
Text Scaling Enhancement (#11)
* Text Scaling Enhancement Added minimumScaleFactor property to allow text shrinking * add textColor to ArcKnob
1 parent c08ceec commit 717ce0d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/Controls/Implementations/ArcKnob.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public struct ArcKnob: View {
77

88
var backgroundColor: Color = .gray
99
var foregroundColor: Color = .red
10+
var textColor: Color = .gray
1011

1112
@State var isShowingValue = false
1213
var range: ClosedRange<Float>
@@ -90,7 +91,10 @@ public struct ArcKnob: View {
9091
Text("\(isShowingValue ? "\(Int(value))" : text)")
9192
.frame(width: dim(geo) * 0.8)
9293
.font(Font.system(size: dim(geo) * 0.2, weight: .bold))
93-
.foregroundColor(backgroundColor)
94+
.foregroundColor(textColor)
95+
.minimumScaleFactor(0.5)
96+
.lineLimit(1)
97+
9498
}
9599
}
96100
}

0 commit comments

Comments
 (0)