diff Framework/Toolbox/ViewportGeometry.cpp @ 332:50e5ec1bdd46 am-2

separating ZoomMouseTracker and PanMouseTracker from WorldSceneWidget
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 17 Oct 2018 19:38:39 +0200
parents 7a364e44fbb4
children f5d5814a41a0
line wrap: on
line diff
--- a/Framework/Toolbox/ViewportGeometry.cpp	Wed Oct 17 15:18:48 2018 +0200
+++ b/Framework/Toolbox/ViewportGeometry.cpp	Wed Oct 17 19:38:39 2018 +0200
@@ -121,6 +121,18 @@
   }
 
 
+  void ViewportGeometry::MapPixelCenterToScene(double& sceneX,
+                                               double& sceneY,
+                                               int x,
+                                               int y) const
+  {
+    // Take the center of the pixel
+    MapDisplayToScene(sceneX, sceneY,
+                      static_cast<double>(x) + 0.5,
+                      static_cast<double>(y) + 0.5);
+  }
+
+
   void ViewportGeometry::FitContent()
   {
     if (width_ > 0 &&