1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Spectrum frequency zoom: inhibit channel move to pointer if Alt modifier is engaged. Fixed effective zoom/pan update on change

This commit is contained in:
f4exb 2021-02-17 23:00:32 +01:00
parent 0966d48d3c
commit e1b0c6d1e9

View File

@ -2228,7 +2228,10 @@ void GLSpectrum::mousePressEvent(QMouseEvent* event)
m_cursorState = CSChannelMoving;
return;
}
else if ((m_cursorState == CSNormal) && (m_channelMarkerStates.size() == 1) && !(event->modifiers() & Qt::ShiftModifier))
else if ((m_cursorState == CSNormal) &&
(m_channelMarkerStates.size() == 1) &&
!(event->modifiers() & Qt::ShiftModifier) &&
!(event->modifiers() & Qt::AltModifier))
{
grabMouse();
setCursor(Qt::SizeHorCursor);
@ -2307,8 +2310,8 @@ void GLSpectrum::frequencyZoom(QWheelEvent *event)
float lim = 0.5f / m_frequencyZoomFactor;
m_frequencyZoomPos = m_frequencyZoomPos < lim ? lim : m_frequencyZoomPos > 1 - lim ? 1 - lim : m_frequencyZoomPos;
updateFFTLimits();
qDebug("GLSpectrum::spectrumZoom: pw: %f p: %f z: %f", pw, m_frequencyZoomPos, m_frequencyZoomFactor);
updateFFTLimits();
}
void GLSpectrum::frequencyPan(QMouseEvent *event)
@ -2325,8 +2328,8 @@ void GLSpectrum::frequencyPan(QMouseEvent *event)
float lim = 0.5f / m_frequencyZoomFactor;
m_frequencyZoomPos = m_frequencyZoomPos < lim ? lim : m_frequencyZoomPos > 1 - lim ? 1 - lim : m_frequencyZoomPos;
updateFFTLimits();
qDebug("GLSpectrum::frequencyPan: pw: %f p: %f", pw, m_frequencyZoomPos);
updateFFTLimits();
}
void GLSpectrum::resetFrequencyZoom()
@ -2348,6 +2351,7 @@ void GLSpectrum::updateFFTLimits()
);
m_spectrumVis->getInputMessageQueue()->push(msg);
m_changesPending = true;
}
void GLSpectrum::setFrequencyScale()