diff --git a/Sources/Controls/Control.swift b/Sources/Controls/Control.swift index 4b27cab..621ed43 100644 --- a/Sources/Controls/Control.swift +++ b/Sources/Controls/Control.swift @@ -69,7 +69,7 @@ public struct Control: View { .onAppear { rect = proxy.frame(in: .local) } - .onChange(of: proxy.size) { + .onChange(of: proxy.size) { _ in rect = proxy.frame(in: .local) } } diff --git a/Sources/Controls/Implementations/IndexedSlider.swift b/Sources/Controls/Implementations/IndexedSlider.swift index df59327..b2c1702 100644 --- a/Sources/Controls/Implementations/IndexedSlider.swift +++ b/Sources/Controls/Implementations/IndexedSlider.swift @@ -40,7 +40,8 @@ public struct IndexedSlider: View { .offset(x: CGFloat(index) * geo.size.width / CGFloat(labels.count)) .animation(.easeOut, value: index) } - }.onChange(of: normalValue) { + } + .onChange(of: normalValue) { _ in index = Int(normalValue * 0.99 * Float(labels.count)) } } diff --git a/Sources/Controls/TwoParameterControl.swift b/Sources/Controls/TwoParameterControl.swift index 13a4edd..e31d5f5 100644 --- a/Sources/Controls/TwoParameterControl.swift +++ b/Sources/Controls/TwoParameterControl.swift @@ -77,7 +77,7 @@ public struct TwoParameterControl: View { .onAppear { rect = proxy.frame(in: .local) } - .onChange(of: proxy.size) { + .onChange(of: proxy.size) { _ in rect = proxy.frame(in: .local) } }