#4574 Summary Plot: Do not modify highlight curve change when zooming

This commit is contained in:
Magne Sjaastad 2019-08-16 14:02:16 +02:00
parent 7295ba8533
commit c78b435864
3 changed files with 28 additions and 4 deletions

View File

@ -174,7 +174,22 @@ bool RiuQwtPlot::eventFilter(QObject* watched, QEvent* event)
{
if(mouseEvent->button() == Qt::LeftButton && mouseEvent->type() == QMouseEvent::MouseButtonRelease)
{
selectClosestCurve(mouseEvent->pos());
bool anyZoomingActive = false;
if (m_zoomerLeft && m_zoomerLeft->isActiveAndValid())
{
anyZoomingActive = true;
}
if (m_zoomerRight && m_zoomerRight->isActiveAndValid())
{
anyZoomingActive = true;
}
if (!anyZoomingActive)
{
selectClosestCurve(mouseEvent->pos());
}
}
}
}

View File

@ -28,9 +28,10 @@
#include <QPointer>
class RiuQwtPlotZoomer;
class QwtPlotCurve;
class QwtPlotGrid;
class QwtPlotZoomer;
class QwtInterval;
class QwtPicker;
class QwtPlotMarker;
@ -82,8 +83,8 @@ private:
};
caf::PdmPointer<RimViewWindow> m_ownerViewWindow;
QPointer<QwtPlotZoomer> m_zoomerLeft;
QPointer<QwtPlotZoomer> m_zoomerRight;
QPointer<RiuQwtPlotZoomer> m_zoomerLeft;
QPointer<RiuQwtPlotZoomer> m_zoomerRight;
std::map<QwtPlotCurve*, CurveColors> m_originalCurveColors;
std::map<QwtPlotCurve*, double> m_originalZValues;

View File

@ -27,6 +27,14 @@ public:
{
}
bool isActiveAndValid() const
{
if (!isActive()) return false;
auto currentSelection = selection();
return accept(currentSelection);
}
protected:
QSizeF minZoomSize() const override
{