Skip to content

Commit

Permalink
Add back clamping in band plan coordinate calculation
Browse files Browse the repository at this point in the history
It was inadvertently removed in #1248.
  • Loading branch information
argilo committed Sep 29, 2023
1 parent 72dda81 commit 9c52c58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qtgui/plotter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2109,8 +2109,8 @@ void CPlotter::drawOverlay()
m_BandPlanHeight = metrics.height() + VER_MARGIN;
for (auto & band : bands)
{
int band_left = xFromFreq(band.minFrequency);
int band_right = xFromFreq(band.maxFrequency);
int band_left = std::max(xFromFreq(band.minFrequency), 0);
int band_right = std::min(xFromFreq(band.maxFrequency), (int)w);
int band_width = band_right - band_left;
QRectF rect(band_left, xAxisTop - m_BandPlanHeight, band_width, m_BandPlanHeight);
painter.fillRect(rect, band.color);
Expand Down

0 comments on commit 9c52c58

Please sign in to comment.