mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#396) Scroll wheel now pans the plot in the depth direction
This commit is contained in:
parent
fd3df6492b
commit
8d7bbb85a9
@ -172,6 +172,15 @@ void RimWellLogPlot::zoomDepth(double zoomFactor)
|
||||
setDepthRange(newMinimum, newMaximum);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogPlot::panDepth(double panFactor)
|
||||
{
|
||||
double delta = panFactor*(m_maximumVisibleDepth - m_minimumVisibleDepth);
|
||||
setDepthRange(m_minimumVisibleDepth + delta, m_maximumVisibleDepth + delta);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -48,6 +48,7 @@ public:
|
||||
RiuWellLogPlot* viewer();
|
||||
|
||||
void zoomDepth(double zoomFactor);
|
||||
void panDepth(double panFactor);
|
||||
void setDepthRange(double minimumDepth, double maximumDepth);
|
||||
|
||||
void updateAvailableDepthRange();
|
||||
|
@ -32,7 +32,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define RIU_SCROLLWHEEL_ZOOMFACTOR 1.05
|
||||
#define RIU_SCROLLWHEEL_ZOOMFACTOR 1.05
|
||||
#define RIU_SCROLLWHEEL_PANFACTOR 0.05
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -132,6 +133,10 @@ void RiuWellLogPlot::wheelEvent(QWheelEvent* event)
|
||||
m_plotDefinition->zoomDepth(1.0/RIU_SCROLLWHEEL_ZOOMFACTOR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotDefinition->panDepth(event->delta() < 0 ? RIU_SCROLLWHEEL_PANFACTOR : -RIU_SCROLLWHEEL_PANFACTOR);
|
||||
}
|
||||
|
||||
event->accept();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user