From 539fecc16b4871f7732c205860d4cca4af7c3524 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Mon, 6 May 2019 21:49:10 -0400 Subject: [PATCH] Fix reported location when double clicking a graph. Now reported X,Y location matches where the circle indicator is actually placed. --- re/graphingwindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/re/graphingwindow.cpp b/re/graphingwindow.cpp index 7316fc5..41d8505 100644 --- a/re/graphingwindow.cpp +++ b/re/graphingwindow.cpp @@ -245,11 +245,15 @@ void GraphingWindow::plottableDoubleClick(QCPAbstractPlottable* plottable, int d double x, y; QCPGraph *graph = reinterpret_cast(plottable); graph->pixelsToCoords(event->localPos(), x, y); - locationText->setText("X: " + QString::number(x) + " Y: " + QString::number(y)); + x = ui->graphingView->xAxis->pixelToCoord(event->localPos().x()); itemTracer->setGraph(graph); itemTracer->setVisible(true); + itemTracer->setInterpolating(true); itemTracer->setGraphKey(x); + itemTracer->updatePosition(); + qDebug() << "val " << itemTracer->position->value(); + locationText->setText("X: " + QString::number(x) + " Y: " + QString::number(itemTracer->position->value())); } void GraphingWindow::gotCenterTimeID(int32_t ID, double timestamp)