From 2a4e59fd6da212bcb0859f7ee8f3a554a07ae6a5 Mon Sep 17 00:00:00 2001 From: Mike Walters Date: Thu, 2 Feb 2017 15:36:52 +0000 Subject: [PATCH] Limit tuner to within plot area on move --- tuner.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tuner.cpp b/tuner.cpp index 9e9bfa7..521ee55 100644 --- a/tuner.cpp +++ b/tuner.cpp @@ -50,6 +50,9 @@ void Tuner::cursorMoved() // Limit deviation range to half of total BW (either side of centre) auto deviationRange = range_t{2, height / 2}; _deviation = deviationRange.clip(std::abs(sender->pos() - cfCursor->pos())); + } else { + auto cfRange = range_t{_deviation, height - _deviation}; + sender->setPos(cfRange.clip(sender->pos())); } updateCursors();