]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
zoom by Shift button
authorCHEMIN Sebastien <sc236498@is245491.intra.cea.fr>
Thu, 7 Mar 2024 11:37:36 +0000 (12:37 +0100)
committerCHEMIN Sebastien <sc236498@is245491.intra.cea.fr>
Thu, 7 Mar 2024 11:37:36 +0000 (12:37 +0100)
src/GraphicsView/GraphicsView_ViewPort.cxx

index 326cd2d8aa4e2e9f79b66b2c9b0273a91fbe5060..af16efdaa75a0f9a7712e40b556b8daf2d4767bd 100644 (file)
@@ -172,6 +172,9 @@ void GraphicsView_ViewPort::mousePressEvent(QMouseEvent *event)
 
 void GraphicsView_ViewPort::mouseMoveEvent(QMouseEvent *event)
 {    
+  if ((event->modifiers() & Qt::ShiftModifier) && (event->buttons() & Qt::LeftButton))
+    activateZoomAction();
+
   if (zooming && (event->buttons() & Qt::LeftButton))
   {
     QPoint currentPos = event->pos();
@@ -230,11 +233,13 @@ void GraphicsView_ViewPort::clearActions()
 void GraphicsView_ViewPort::activateZoomAction() 
 { 
   zooming = true;
+  fittingArea = false;
   setCursor(*zoomCursor); 
 }
 
 void GraphicsView_ViewPort::activateFitAreaAction() 
 { 
   fittingArea = true;
+  zooming = false;
   setCursor(Qt::PointingHandCursor);
 }