mirror of
https://github.com/JS8Call-improved/JS8Call-improved
synced 2026-08-13 17:47:36 -04:00
Ensure bins per pixel sanity in manipulator
Clamp the low bound of the bins per pixel value to 1 in the manipulator, not later on, by which time it’s already too late.
This commit is contained in:
parent
91cf199083
commit
3925440507
1 changed files with 1 additions and 3 deletions
|
|
@ -478,8 +478,6 @@ CPlotter::DrawOverlayScale(double const df,
|
|||
p.setPen(Qt::black);
|
||||
p.drawRect(0, 0, m_w, 30);
|
||||
|
||||
if (m_binsPerPixel < 1) m_binsPerPixel = 1;
|
||||
|
||||
std::size_t const hdivs = m_w * df / m_freqPerDiv + 0.9999;
|
||||
int f = ((m_startFreq + m_freqPerDiv - 1) / m_freqPerDiv) * m_freqPerDiv;
|
||||
double const xOffset = float(f - m_startFreq) / m_freqPerDiv;
|
||||
|
|
@ -685,7 +683,7 @@ void CPlotter::UpdateOverlay() //UpdateOverlay
|
|||
|
||||
void CPlotter::setBinsPerPixel(int const n) //setBinsPerPixel
|
||||
{
|
||||
m_binsPerPixel = n;
|
||||
m_binsPerPixel = n < 1 ? 1 : n;
|
||||
DrawOverlay(); //Redraw scales and ticks
|
||||
update(); //trigger a new paintEvent}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue