Overflow/replot bugfix when moving markers

This commit is contained in:
Jan Käberich 2020-11-26 21:00:16 +01:00
parent 1a7212191a
commit 19bc31b7cc
2 changed files with 3 additions and 2 deletions

View File

@ -227,6 +227,7 @@ void TracePlot::dropEvent(QDropEvent *event)
} }
dropPending = false; dropPending = false;
dropTrace = nullptr; dropTrace = nullptr;
replot();
} }
void TracePlot::dragLeaveEvent(QDragLeaveEvent *event) void TracePlot::dragLeaveEvent(QDragLeaveEvent *event)

View File

@ -777,8 +777,8 @@ double TraceXYPlot::nearestTracePoint(Trace *t, QPoint pixel)
continue; continue;
} }
auto plotPoint = plotValueToPixel(point, 0); auto plotPoint = plotValueToPixel(point, 0);
auto diff = plotPoint - pixel; QPointF diff = plotPoint - pixel;
unsigned int distance = diff.x() * diff.x() + diff.y() * diff.y(); auto distance = diff.x() * diff.x() + diff.y() * diff.y();
if(distance < closestDistance) { if(distance < closestDistance) {
closestDistance = distance; closestDistance = distance;
closestXpos = point.x(); closestXpos = point.x();