File tree Expand file tree Collapse file tree
Sources/DSWaveformImage/Renderers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ public struct LinearWaveformRenderer: WaveformRenderer {
4949 let positionAdjustedGraphCenter = position. offset ( ) * graphRect. size. height
5050 let drawMappingFactor = graphRect. size. height * configuration. verticalScalingFactor
5151 let minimumGraphAmplitude : CGFloat = 1 / configuration. scale // we want to see at least a 1px line for silence
52+ var lastXPos : CGFloat = 0
5253
5354 for (index, sample) in samples. enumerated ( ) {
5455 let adjustedIndex : Int
@@ -74,6 +75,7 @@ public struct LinearWaveformRenderer: WaveformRenderer {
7475 let drawingAmplitude = max ( minimumGraphAmplitude, invertedDbSample * drawMappingFactor)
7576 let drawingAmplitudeUp = positionAdjustedGraphCenter - drawingAmplitude
7677 let drawingAmplitudeDown = positionAdjustedGraphCenter + drawingAmplitude
78+ lastXPos = xPos
7779
7880 switch sides {
7981 case . up:
@@ -88,6 +90,10 @@ public struct LinearWaveformRenderer: WaveformRenderer {
8890 }
8991 }
9092
93+ if case . striped = configuration. style {
94+ path. move ( to: CGPoint ( x: lastXPos, y: positionAdjustedGraphCenter) )
95+ }
96+
9197 return path
9298 }
9399}
You can’t perform that action at this time.
0 commit comments