diff --git a/Sources/Controls/Control.swift b/Sources/Controls/Control.swift index f13cb1a..4b27cab 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) { newValue in + .onChange(of: proxy.size) { rect = proxy.frame(in: .local) } } diff --git a/Sources/Controls/Implementations/IndexedSlider.swift b/Sources/Controls/Implementations/IndexedSlider.swift index cdecaa9..df59327 100644 --- a/Sources/Controls/Implementations/IndexedSlider.swift +++ b/Sources/Controls/Implementations/IndexedSlider.swift @@ -40,8 +40,8 @@ public struct IndexedSlider: View { .offset(x: CGFloat(index) * geo.size.width / CGFloat(labels.count)) .animation(.easeOut, value: index) } - }.onChange(of: normalValue) { newValue in - index = Int(newValue * 0.99 * Float(labels.count)) + }.onChange(of: normalValue) { + index = Int(normalValue * 0.99 * Float(labels.count)) } } } diff --git a/Sources/Controls/TwoParameterControl.swift b/Sources/Controls/TwoParameterControl.swift index 46c8402..13a4edd 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) { newValue in + .onChange(of: proxy.size) { rect = proxy.frame(in: .local) } }