File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ extension CompactSlider {
1111
1212 isValueChangingInternally = true
1313 defer {
14- isValueChangingInternally = false
14+ Task { @MainActor in
15+ isValueChangingInternally = false
16+ }
1517 }
1618
1719 if progress. isMultipleValues {
@@ -49,10 +51,6 @@ extension CompactSlider {
4951 upperValue = convertProgressToValue ( newValue. progresses [ 1 ] )
5052 }
5153
52- func convertProgressToValue( _ newValue: Double ) -> Value {
53- newValue. convertPercentageToValue ( in: bounds, step: step? . linearStep ( ) ?? 0.0 )
54- }
55-
5654 func onLowerValueChange( _ newValue: Value ) {
5755 if isValueChangingInternally { return }
5856 progress. updateLowerProgress ( convertValueToProgress ( newValue) )
@@ -82,6 +80,14 @@ extension CompactSlider {
8280 if isValueChangingInternally { return }
8381 progress. updatePolarPoint ( newValue)
8482 }
83+ }
84+
85+ // MARK: - Convert values
86+
87+ extension CompactSlider {
88+ func convertProgressToValue( _ newValue: Double ) -> Value {
89+ newValue. convertPercentageToValue ( in: bounds, step: step? . linearStep ( ) ?? 0.0 )
90+ }
8591
8692 func convertValueToProgress( _ value: Value ) -> Double {
8793 value. convertValueToPercentage ( in: bounds)
You can’t perform that action at this time.
0 commit comments