From 0bf5872f33e0bc4035166bff69ba1e3ca91f2d85 Mon Sep 17 00:00:00 2001 From: "adam@algroup.co.uk" Date: Wed, 8 Jul 2009 00:17:06 +0000 Subject: [PATCH] initialise cursor positions so 'dt' will show correct value. show cursor a & b positions. --- linux/proxguiqt.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/linux/proxguiqt.cpp b/linux/proxguiqt.cpp index 773d74b8..cd8d9a73 100644 --- a/linux/proxguiqt.cpp +++ b/linux/proxguiqt.cpp @@ -97,6 +97,11 @@ void ProxWidget::paintEvent(QPaintEvent *event) GraphStart = 0; } + if (CursorAPos > GraphTraceLen) + CursorAPos= 0; + if(CursorBPos > GraphTraceLen) + CursorBPos= 0; + r = rect(); painter.fillRect(r, QColor(0, 0, 0)); @@ -226,9 +231,9 @@ void ProxWidget::paintEvent(QPaintEvent *event) painter.drawPath(cursorBPath); char str[100]; - sprintf(str, "@%d max=%d min=%d mean=%d n=%d/%d dt=%d [%.3f]", + sprintf(str, "@%d max=%d min=%d mean=%d n=%d/%d dt=%d [%.3f] zoom=%.3f CursorA=%d CursorB=%d", GraphStart, yMax, yMin, yMean, n, GraphTraceLen, - CursorBPos - CursorAPos, (CursorBPos - CursorAPos)/CursorScaleFactor); + CursorBPos - CursorAPos, (CursorBPos - CursorAPos)/CursorScaleFactor,GraphPixelsPerPoint,CursorAPos,CursorBPos); painter.setPen(QColor(255, 255, 255)); painter.drawText(50, r.bottom() - 20, str); -- 2.39.2