Skip to content
Permalink
Browse files
can re-center when scaling mapCanvas extent
  • Loading branch information
3nids committed Jul 25, 2014
1 parent 6f23cb6 commit a9289b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
@@ -238,7 +238,8 @@ class QgsMapCanvas : QGraphicsView
void zoomScale( double scale );

//! Zoom with the factor supplied. Factor > 1 zooms out, interval (0,1) zooms in
void zoomByFactor( double scaleFactor );
//! If point is given, re-center on it
void zoomByFactor( double scaleFactor, const QgsPoint *center = 0 );

//! Zooms in/out with a given center
void zoomWithCenter( int x, int y, bool zoomIn );
@@ -1815,10 +1815,10 @@ void QgsMapCanvas::getDatumTransformInfo( const QgsMapLayer* ml, const QString&
}
}

void QgsMapCanvas::zoomByFactor( double scaleFactor )
void QgsMapCanvas::zoomByFactor( double scaleFactor , const QgsPoint* center )
{
QgsRectangle r = mapSettings().visibleExtent();
r.scale( scaleFactor );
r.scale( scaleFactor, center );
setExtent( r );
refresh();
}
@@ -307,7 +307,8 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
void zoomScale( double scale );

//! Zoom with the factor supplied. Factor > 1 zooms out, interval (0,1) zooms in
void zoomByFactor( double scaleFactor );
//! If point is given, re-center on it
void zoomByFactor( double scaleFactor, const QgsPoint *center = 0 );

//! Zooms in/out with a given center
void zoomWithCenter( int x, int y, bool zoomIn );

0 comments on commit a9289b6

Please sign in to comment.