diff --git a/GUI/View/PlotUtil/PlotEventHelper.cpp b/GUI/View/PlotUtil/PlotEventHelper.cpp index 5ceb02dd64a3f5eabaf01c9c7485e6300f04109d..ed32df775e8ac060038d4f8c3d549c5a09d7ca1e 100644 --- a/GUI/View/PlotUtil/PlotEventHelper.cpp +++ b/GUI/View/PlotUtil/PlotEventHelper.cpp @@ -46,7 +46,9 @@ void PlotEventHelper::setMouseTrackingEnabled(bool enable) void PlotEventHelper::onCustomMouseMove(QMouseEvent* event) { - auto currentPos = currentPlotDescriptor(event); + double x = m_plot->customPlot()->xAxis->pixelToCoord(event->pos().x()); + double y = m_plot->customPlot()->yAxis->pixelToCoord(event->pos().y()); + PlotEventInfo currentPos = m_plot->eventInfo(x, y); if (currentPos.inAxesRange()) { m_plot->statusString(currentPos.infoString()); @@ -62,12 +64,3 @@ void PlotEventHelper::onCustomMouseMove(QMouseEvent* event) m_prevPos = currentPos; } - -//! Constructs current position of the data. - -PlotEventInfo PlotEventHelper::currentPlotDescriptor(QMouseEvent* event) const -{ - double x = m_plot->customPlot()->xAxis->pixelToCoord(event->pos().x()); - double y = m_plot->customPlot()->yAxis->pixelToCoord(event->pos().y()); - return m_plot->eventInfo(x, y); -} diff --git a/GUI/View/PlotUtil/PlotEventHelper.h b/GUI/View/PlotUtil/PlotEventHelper.h index e27f615be93f7ef8fbc76b5c362b7ce863600b62..a4ae27cff8202516715aefe2503876d955225e69 100644 --- a/GUI/View/PlotUtil/PlotEventHelper.h +++ b/GUI/View/PlotUtil/PlotEventHelper.h @@ -43,8 +43,6 @@ public slots: void onCustomMouseMove(QMouseEvent* event); private: - PlotEventInfo currentPlotDescriptor(QMouseEvent* event) const; - ScientificPlot* m_plot; PlotEventInfo m_prevPos; };