From 715eec03aa9ac60c068381cd289a309ef11fcc9e Mon Sep 17 00:00:00 2001 From: Aurelius Prochazka Date: Sun, 28 Jan 2024 13:34:21 -0800 Subject: [PATCH] Fixed warnings --- Sources/Controls/Control.swift | 2 +- Sources/Controls/Implementations/IndexedSlider.swift | 4 ++-- Sources/Controls/TwoParameterControl.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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) } }