diff --git a/Software/PC_Application/Traces/traceplot.cpp b/Software/PC_Application/Traces/traceplot.cpp index 0c953a6..083cb18 100644 --- a/Software/PC_Application/Traces/traceplot.cpp +++ b/Software/PC_Application/Traces/traceplot.cpp @@ -227,6 +227,7 @@ void TracePlot::dropEvent(QDropEvent *event) } dropPending = false; dropTrace = nullptr; + replot(); } void TracePlot::dragLeaveEvent(QDragLeaveEvent *event) diff --git a/Software/PC_Application/Traces/tracexyplot.cpp b/Software/PC_Application/Traces/tracexyplot.cpp index bb53d33..fd9eb65 100644 --- a/Software/PC_Application/Traces/tracexyplot.cpp +++ b/Software/PC_Application/Traces/tracexyplot.cpp @@ -777,8 +777,8 @@ double TraceXYPlot::nearestTracePoint(Trace *t, QPoint pixel) continue; } auto plotPoint = plotValueToPixel(point, 0); - auto diff = plotPoint - pixel; - unsigned int distance = diff.x() * diff.x() + diff.y() * diff.y(); + QPointF diff = plotPoint - pixel; + auto distance = diff.x() * diff.x() + diff.y() * diff.y(); if(distance < closestDistance) { closestDistance = distance; closestXpos = point.x();