mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3794 Improve wheel zooming
This commit is contained in:
@@ -60,7 +60,7 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
cvfEventPos(me->x(), me->y(), &translatedMousePosX, &translatedMousePosY);
|
||||
|
||||
if (me->button() == Qt::MidButton && me->modifiers() == Qt::NoModifier && isRotationEnabled())
|
||||
{
|
||||
{
|
||||
cvf::HitItemCollection hic;
|
||||
bool hitSomething = m_viewer->rayPick( me->x(), me->y(), &hic);
|
||||
|
||||
@@ -86,6 +86,7 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
m_hasMovedMouseDuringNavigation = false;
|
||||
isEventHandled = true;
|
||||
}
|
||||
forcePointOfInterestUpdateDuringNextWheelZoom();
|
||||
}
|
||||
break;
|
||||
case QEvent::MouseButtonRelease:
|
||||
@@ -103,6 +104,7 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
|
||||
}
|
||||
}
|
||||
forcePointOfInterestUpdateDuringNextWheelZoom();
|
||||
}
|
||||
break;
|
||||
case QEvent::MouseMove:
|
||||
@@ -133,11 +135,12 @@ bool RiuCadNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
{
|
||||
if (inputEvent->modifiers() == Qt::NoModifier)
|
||||
{
|
||||
initializeRotationCenter();
|
||||
QWheelEvent* we = static_cast<QWheelEvent*>(inputEvent);
|
||||
|
||||
updatePointOfInterestDuringZoomIfNecessary(we->x(), we->y());
|
||||
|
||||
if (m_isRotCenterInitialized)
|
||||
{
|
||||
QWheelEvent* we = static_cast<QWheelEvent*> ( inputEvent);
|
||||
|
||||
int translatedMousePosX, translatedMousePosY;
|
||||
cvfEventPos(we->x(), we->y(), &translatedMousePosX, &translatedMousePosY);
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ bool RiuGeoQuestNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
isEventHandled = true;
|
||||
}
|
||||
}
|
||||
forcePointOfInterestUpdateDuringNextWheelZoom();
|
||||
}
|
||||
break;
|
||||
case QEvent::MouseButtonRelease:
|
||||
@@ -144,11 +145,12 @@ bool RiuGeoQuestNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
{
|
||||
if (inputEvent->modifiers() == Qt::NoModifier)
|
||||
{
|
||||
initializeRotationCenter();
|
||||
QWheelEvent* we = static_cast<QWheelEvent*>(inputEvent);
|
||||
|
||||
updatePointOfInterestDuringZoomIfNecessary(we->x(), we->y());
|
||||
|
||||
if (m_isRotCenterInitialized)
|
||||
{
|
||||
QWheelEvent* we = static_cast<QWheelEvent*>(inputEvent);
|
||||
|
||||
int translatedMousePosX, translatedMousePosY;
|
||||
cvfEventPos(we->x(), we->y(), &translatedMousePosX, &translatedMousePosY);
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ bool RiuRmsNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
m_isZooming = true;
|
||||
}
|
||||
}
|
||||
|
||||
forcePointOfInterestUpdateDuringNextWheelZoom();
|
||||
}
|
||||
break;
|
||||
case QEvent::MouseButtonRelease:
|
||||
@@ -130,6 +130,7 @@ bool RiuRmsNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
m_hasMovedMouseDuringNavigation = false;
|
||||
}
|
||||
}
|
||||
forcePointOfInterestUpdateDuringNextWheelZoom();
|
||||
}
|
||||
break;
|
||||
case QEvent::MouseMove:
|
||||
@@ -169,7 +170,10 @@ bool RiuRmsNavigation::handleInputEvent(QInputEvent* inputEvent)
|
||||
{
|
||||
if (inputEvent->modifiers() == Qt::NoModifier)
|
||||
{
|
||||
initializeRotationCenter();
|
||||
QWheelEvent* we = static_cast<QWheelEvent*>(inputEvent);
|
||||
|
||||
updatePointOfInterestDuringZoomIfNecessary(we->x(), we->y());
|
||||
|
||||
if (m_isRotCenterInitialized)
|
||||
{
|
||||
QWheelEvent* we = static_cast<QWheelEvent*> ( inputEvent);
|
||||
|
||||
Reference in New Issue
Block a user