From e4f00c52dae72468fc599affdacfc2a9d2dde53e Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 13 May 2019 20:29:18 +0200 Subject: [PATCH] Fix #194 Graph window loops to end if you scroll left past 0 --- client/proxguiqt.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/proxguiqt.cpp b/client/proxguiqt.cpp index e2ef546f6..8357c785f 100644 --- a/client/proxguiqt.cpp +++ b/client/proxguiqt.cpp @@ -586,7 +586,7 @@ void Plot::mouseMoveEvent(QMouseEvent *event) { } void Plot::keyPressEvent(QKeyEvent *event) { - int offset; + uint32_t offset; if (event->modifiers() & Qt::ShiftModifier) { if (PlotGridX) @@ -623,9 +623,15 @@ void Plot::keyPressEvent(QKeyEvent *event) { case Qt::Key_Left: if (GraphPixelsPerPoint < 20) { - GraphStart -= offset; + if (GraphStart >= offset) { + GraphStart -= offset; + } else { + GraphStart = 0; + } } else { - GraphStart--; + if (GraphStart > 0) { + GraphStart--; + } } break;