Skip to content

Commit b941cf3

Browse files
author
mhugent
committed
Allow dpi values to be doubles. This fixes unprecise scale bars in composer
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9298 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 626ab41 commit b941cf3

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/core/qgsscalecalculator.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@
2323
#include "qgsrect.h"
2424
#include "qgsscalecalculator.h"
2525

26-
QgsScaleCalculator::QgsScaleCalculator( int dpi, QGis::units mapUnits )
26+
QgsScaleCalculator::QgsScaleCalculator( double dpi, QGis::units mapUnits )
2727
: mDpi( dpi ), mMapUnits( mapUnits )
2828
{}
2929

3030
QgsScaleCalculator::~QgsScaleCalculator()
3131
{}
3232

33-
void QgsScaleCalculator::setDpi( int dpi )
33+
void QgsScaleCalculator::setDpi( double dpi )
3434
{
3535
mDpi = dpi;
3636
}
37-
int QgsScaleCalculator::dpi()
37+
double QgsScaleCalculator::dpi()
3838
{
3939
return mDpi;
4040
}

src/core/qgsscalecalculator.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CORE_EXPORT QgsScaleCalculator
3939
* @param mapUnits Units of the data on the map. Must match a value from the
4040
* QGis::units enum (METERS, FEET, DEGREES)
4141
*/
42-
QgsScaleCalculator( int dpi = 0,
42+
QgsScaleCalculator( double dpi = 0,
4343
QGis::units mapUnits = QGis::METERS );
4444

4545
//! Destructor
@@ -49,12 +49,12 @@ class CORE_EXPORT QgsScaleCalculator
4949
* Set the dpi to be used in scale calculations
5050
* @param dpi Dots per inch of monitor resolution
5151
*/
52-
void setDpi( int dpi );
52+
void setDpi( double dpi );
5353
/**
5454
* Accessor for dpi used in scale calculations
5555
* @return int the dpi used for scale calculations.
5656
*/
57-
int dpi();
57+
double dpi();
5858

5959
/**
6060
* Set the map units
@@ -84,7 +84,7 @@ class CORE_EXPORT QgsScaleCalculator
8484
private:
8585

8686
//! dpi member
87-
int mDpi;
87+
double mDpi;
8888

8989
//! map unit member
9090
QGis::units mMapUnits;

0 commit comments

Comments
 (0)