Skip to content

Commit

Permalink
First quadrant flipping only once in the body
Browse files Browse the repository at this point in the history
  • Loading branch information
mahal committed Apr 12, 2024
1 parent 2cd4285 commit c55a8b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ public struct SpectrogramFlatView: View {
}
HStack(spacing: 0.0) {
ForEach(spectrogram.slices.items) { slice in
// flip it as the slice was drawn in the first quadrant
slice.scaleEffect(x: 1, y: -1)
slice
}
// flip it so the new slices come in right and move to the left
.scaleEffect(x: -1, y: 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ struct SpectrogramSlice: View, Identifiable {

public var body: some View {
return Image(uiImage: cachedUIImage).resizable()
// flip it as the slice was drawn in the first quadrant
.scaleEffect(x: 1, y: -1)
}

// This code draws in the first quadrant, it's much easier to understand
Expand Down Expand Up @@ -286,7 +288,7 @@ struct SpectrogramSlice_Previews: PreviewProvider {
CGPoint(x: 8800, y: -40),
CGPoint(x: 8000, y: -10)],
fftMetaData: SpectrogramFFTMetaData()
).scaleEffect(x: 1, y: -1)
)
}
}

Expand Down

0 comments on commit c55a8b5

Please sign in to comment.