mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-12-27 03:18:30 +01:00
Implemented #1205
This commit is contained in:
parent
5f297b1a69
commit
78daed7879
@ -574,10 +574,22 @@ void MainWindow::draw() {
|
|||||||
// Handle scrollwheel
|
// Handle scrollwheel
|
||||||
int wheel = ImGui::GetIO().MouseWheel;
|
int wheel = ImGui::GetIO().MouseWheel;
|
||||||
if (wheel != 0 && (gui::waterfall.mouseInFFT || gui::waterfall.mouseInWaterfall)) {
|
if (wheel != 0 && (gui::waterfall.mouseInFFT || gui::waterfall.mouseInWaterfall)) {
|
||||||
|
// Select factor depending on modifier keys
|
||||||
|
double interval;
|
||||||
|
if (ImGui::IsKeyDown(ImGuiKey_LeftShift)) {
|
||||||
|
interval = vfo->snapInterval * 10.0;
|
||||||
|
}
|
||||||
|
else if (ImGui::IsKeyDown(ImGuiKey_LeftAlt)) {
|
||||||
|
interval = vfo->snapInterval * 0.1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
interval = vfo->snapInterval;
|
||||||
|
}
|
||||||
|
|
||||||
double nfreq;
|
double nfreq;
|
||||||
if (vfo != NULL) {
|
if (vfo != NULL) {
|
||||||
nfreq = gui::waterfall.getCenterFrequency() + vfo->generalOffset + (vfo->snapInterval * wheel);
|
nfreq = gui::waterfall.getCenterFrequency() + vfo->generalOffset + (interval * wheel);
|
||||||
nfreq = roundl(nfreq / vfo->snapInterval) * vfo->snapInterval;
|
nfreq = roundl(nfreq / interval) * interval;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nfreq = gui::waterfall.getCenterFrequency() - (gui::waterfall.getViewBandwidth() * wheel / 20.0);
|
nfreq = gui::waterfall.getCenterFrequency() - (gui::waterfall.getViewBandwidth() * wheel / 20.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user