Skip to content

Commit

Permalink
Update SampleWaveform.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: szeli1 <[email protected]>
  • Loading branch information
sakertooth and szeli1 authored Dec 30, 2024
1 parent dd062fe commit 2784c32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/SampleWaveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ void SampleWaveform::visualize(Parameters parameters, QPainter& painter, const Q
const auto endSample = parameters.buffer + endSampleIndex;

const auto [minPeak, maxPeak] = std::minmax_element(&startSample->left(), &endSample->right());
const auto yMin = rect.center().y() - *minPeak * parameters.amplification * verticalScale;
const auto yMax = rect.center().y() - *maxPeak * parameters.amplification * verticalScale;
const auto yMin = rect.center().y() - (*minPeak) * parameters.amplification * verticalScale;
const auto yMax = rect.center().y() - (*maxPeak) * parameters.amplification * verticalScale;

painter.drawLine(xPos, yMin, xPos, yMax);
}
Expand Down

0 comments on commit 2784c32

Please sign in to comment.