File tree Expand file tree Collapse file tree
Sources/DSWaveformImageViews/SwiftUI Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ public struct WaveformView<Content: View>: View {
4141 public var body : some View {
4242 GeometryReader { geometry in
4343 content ( WaveformShape ( samples: samples, configuration: configuration, renderer: renderer) )
44- . scaleEffect ( x: scaleDuringResize ( for: geometry) , y: 1 , anchor: . trailing)
4544 . onAppear {
4645 guard samples. isEmpty else { return }
4746 update ( size: geometry. size, url: audioURL, configuration: configuration)
@@ -78,18 +77,6 @@ public struct WaveformView<Content: View>: View {
7877 updateTask ( nil )
7978 }
8079 }
81-
82- /*
83- * During resizing, we only visually scale the shape to make it look more seamless,
84- * before we re-calculate the pixel-perfect re-sampled waveform, which is costly.
85- * Due to the complex way we need to render the actual waveform based on samples
86- * available and size to occupy, the re-scaling currently only supports enlarging.
87- * If we resize to a smaller size, the waveform simply overflows.
88- */
89- private func scaleDuringResize( for geometry: GeometryProxy ) -> CGFloat {
90- guard currentSize != . zero else { return 1 }
91- return max ( geometry. size. width / currentSize. width, 1 )
92- }
9380}
9481
9582public extension WaveformView {
You can’t perform that action at this time.
0 commit comments