patch.txt
1 |
### Eclipse Workspace Patch 1.0 |
---|---|
2 |
#P qgis |
3 |
Index: src/gui/qgsmapcanvas.h |
4 |
=================================================================== |
5 |
--- src/gui/qgsmapcanvas.h (revision 13475) |
6 |
+++ src/gui/qgsmapcanvas.h (working copy) |
7 |
@@ -231,6 +231,9 @@ |
8 |
//! Zoom with the factor supplied. Factor > 1 zooms out, interval (0,1) zooms in |
9 |
void zoomByFactor( double scaleFactor ); |
10 |
|
11 |
+ //! Zoom to a specific scale |
12 |
+ void zoomScale(double scale); |
13 |
+ |
14 |
//! Zooms in/out with a given center |
15 |
void zoomWithCenter( int x, int y, bool zoomIn ); |
16 |
|
17 |
Index: src/gui/qgsmapcanvas.cpp |
18 |
=================================================================== |
19 |
--- src/gui/qgsmapcanvas.cpp (revision 13475) |
20 |
+++ src/gui/qgsmapcanvas.cpp (working copy) |
21 |
@@ -1432,6 +1432,14 @@ |
22 |
refresh(); |
23 |
} |
24 |
|
25 |
+ |
26 |
+void QgsMapCanvas::zoomScale(double scale) |
27 |
+{ |
28 |
+ // Since it is an adjustment of scale, we do: |
29 |
+ double factor = scale / mMapRenderer->scale(); |
30 |
+ this->zoomByFactor(factor); |
31 |
+} |
32 |
+ |
33 |
void QgsMapCanvas::selectionChangedSlot() |
34 |
{ |
35 |
// Find out which layer it was that sent the signal. |