Skip to content

Commit 5f1ce68

Browse files
committed
remove rescaling during resize again
was only meant for illustration purposes for #104
1 parent c2e5261 commit 5f1ce68

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

Sources/DSWaveformImageViews/SwiftUI/WaveformView.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff 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

9582
public extension WaveformView {

0 commit comments

Comments
 (0)