Skip to content
Snippets Groups Projects
Commit 3edea0e4 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

save only bool m_was_inside

parent d00cb796
No related branches found
No related tags found
1 merge request!2113rm PlotEventInfo
......@@ -19,7 +19,6 @@
PlotEventHelper::PlotEventHelper(ScientificPlot* scientific_plot)
: QObject(scientific_plot)
, m_plot(scientific_plot)
, m_prevPos(scientific_plot->plotType())
{
}
......@@ -52,15 +51,17 @@ void PlotEventHelper::onCustomMouseMove(QMouseEvent* event)
if (currentPos.inAxesRange()) {
m_plot->statusString(m_plot->infoString(event));
if (!m_prevPos.inAxesRange())
if (!m_was_inside) {
enteringPlot();
m_was_inside = true;
}
positionChanged(x, y);
positionChanged(currentPos.x(), currentPos.y());
} else if (m_prevPos.inAxesRange()) {
m_plot->statusString("");
leavingPlot();
} else {
if (m_was_inside) {
m_plot->statusString("");
leavingPlot();
m_was_inside = false;
}
}
m_prevPos = currentPos;
}
......@@ -44,7 +44,7 @@ public slots:
private:
ScientificPlot* m_plot;
PlotEventInfo m_prevPos;
bool m_was_inside = false;
};
#endif // BORNAGAIN_GUI_VIEW_PLOTUTIL_PLOTEVENTHELPER_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment