Skip to content

Commit

Permalink
Text Scaling Enhancement (#11)
Browse files Browse the repository at this point in the history
* Text Scaling Enhancement

Added minimumScaleFactor property to allow text shrinking

* add textColor to ArcKnob
  • Loading branch information
EssamSoft committed Sep 12, 2024
1 parent c08ceec commit 717ce0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Controls/Implementations/ArcKnob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public struct ArcKnob: View {

var backgroundColor: Color = .gray
var foregroundColor: Color = .red
var textColor: Color = .gray

@State var isShowingValue = false
var range: ClosedRange<Float>
Expand Down Expand Up @@ -90,7 +91,10 @@ public struct ArcKnob: View {
Text("\(isShowingValue ? "\(Int(value))" : text)")
.frame(width: dim(geo) * 0.8)
.font(Font.system(size: dim(geo) * 0.2, weight: .bold))
.foregroundColor(backgroundColor)
.foregroundColor(textColor)
.minimumScaleFactor(0.5)
.lineLimit(1)

}
}
}
Expand Down

0 comments on commit 717ce0d

Please sign in to comment.