Skip to content

Commit

Permalink
Merge pull request #1283 from gqrx-sdr/bandplan-clamping
Browse files Browse the repository at this point in the history
Add back clamping in band plan coordinate calculation
  • Loading branch information
argilo authored Sep 29, 2023
2 parents 72dda81 + 9c52c58 commit 707e6c1
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 707e6c1

Please sign in to comment.