]> SALOME platform Git repositories - modules/gui.git/blobdiff - src/OCCViewer/OCCViewer_ViewSketcher.cxx
Salome HOME
[bos #32216][CEA] GUI ergonomic with HDPI screens.
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewSketcher.cxx
index b4621257770aa28042ead568820e370958916f94..d59345aa78a1fefaf1b3c476426a442c45b5d153 100644 (file)
@@ -20,6 +20,7 @@
 #include "OCCViewer_ViewSketcher.h"
 #include "OCCViewer_ViewWindow.h"
 #include "OCCViewer_ViewPort3d.h"
+#include "ViewerTools_ScreenScaling.h"
 
 #include "QtxRubberBand.h"
 
@@ -122,6 +123,13 @@ bool OCCViewer_ViewSketcher::eventFilter( QObject* o, QEvent* e )
 {
   OCCViewer_ViewPort3d* avp = mypViewWindow->getViewPort();
 
+  // We need to downscale only non-system events here
+  if (!e->spontaneous())
+  {
+    // Make a copy event with updated coordinates
+    e = ViewerTools_ScreenScaling::getDpiAwareEvent(e, false);
+  }
+
   QMouseEvent* me = (QMouseEvent*)e;
   SketchState state = EnTrain;
   bool ignore = false;