[Marble-commits] KDE/kdeedu/marble/src

Bernhard Beschow bbeschow at cs.tu-berlin.de
Wed Oct 6 16:56:47 CEST 2010


SVN commit 1183221 by beschow:

always calculate the screen coordinates of the focus point via the viewport in crosshairs plugin

* remove ViewportParams::focusPointIsCenter()

 M  +0 -5      lib/ViewportParams.cpp  
 M  +0 -8      lib/ViewportParams.h  
 M  +6 -9      plugins/render/crosshairs/CrosshairsPlugin.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/ViewportParams.cpp #1183220:1183221
@@ -415,9 +415,4 @@
     d->m_hasFocusPoint = false;
 }
 
-bool ViewportParams::focusPointIsCenter() const
-{
-    return !d->m_hasFocusPoint;
 }
-
-}
--- trunk/KDE/kdeedu/marble/src/lib/ViewportParams.h #1183220:1183221
@@ -123,14 +123,6 @@
       */
     void resetFocusPoint();
 
-    /**
-      * @brief Determine whether the focus point is different from the center point
-      * @return False iff an explicit focus point was set with @ref setFocusPoint
-      * and @ref resetFocusPoint has not been called afterwards
-      * @see focusPoint setFocusPoint resetFocusPoint
-      */
-    bool focusPointIsCenter() const;
-
  private:
     Q_DISABLE_COPY( ViewportParams )
     ViewportParamsPrivate * const d;
--- trunk/KDE/kdeedu/marble/src/plugins/render/crosshairs/CrosshairsPlugin.cpp #1183220:1183221
@@ -75,16 +75,13 @@
     Q_UNUSED( layer )
 
     if ( renderPos == "ALWAYS_ON_TOP" ) {
-        qreal  centerx  = viewport->width() / 2;
-        qreal  centery  = viewport->height() / 2;
-        int  boxwidth = 6;
-        int  boxheight = 2;
-        int  boxoffset = 4;
+        const int  boxwidth = 6;
+        const int  boxheight = 2;
+        const int  boxoffset = 4;
 
-        GeoDataCoordinates focusPoint = viewport->focusPoint();
-        if (!viewport->focusPointIsCenter()) {
-            viewport->currentProjection()->screenCoordinates(focusPoint, viewport, centerx, centery);
-        }
+        qreal centerx = 0.0;
+        qreal centery = 0.0;
+        viewport->currentProjection()->screenCoordinates(viewport->focusPoint(), viewport, centerx, centery);
 
         painter->save();
 


More information about the Marble-commits mailing list