Skip to content

Commit

Permalink
Allow dpi values to be doubles. This fixes unprecise scale bars in co…
Browse files Browse the repository at this point in the history
…mposer

git-svn-id: http://svn.osgeo.org/qgis/trunk@9298 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 11, 2008
1 parent 4a49d3d commit 284902a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsscalecalculator.cpp
Expand Up @@ -23,18 +23,18 @@
#include "qgsrect.h"
#include "qgsscalecalculator.h"

QgsScaleCalculator::QgsScaleCalculator( int dpi, QGis::units mapUnits )
QgsScaleCalculator::QgsScaleCalculator( double dpi, QGis::units mapUnits )
: mDpi( dpi ), mMapUnits( mapUnits )
{}

QgsScaleCalculator::~QgsScaleCalculator()
{}

void QgsScaleCalculator::setDpi( int dpi )
void QgsScaleCalculator::setDpi( double dpi )
{
mDpi = dpi;
}
int QgsScaleCalculator::dpi()
double QgsScaleCalculator::dpi()
{
return mDpi;
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsscalecalculator.h
Expand Up @@ -39,7 +39,7 @@ class CORE_EXPORT QgsScaleCalculator
* @param mapUnits Units of the data on the map. Must match a value from the
* QGis::units enum (METERS, FEET, DEGREES)
*/
QgsScaleCalculator( int dpi = 0,
QgsScaleCalculator( double dpi = 0,
QGis::units mapUnits = QGis::METERS );

//! Destructor
Expand All @@ -49,12 +49,12 @@ class CORE_EXPORT QgsScaleCalculator
* Set the dpi to be used in scale calculations
* @param dpi Dots per inch of monitor resolution
*/
void setDpi( int dpi );
void setDpi( double dpi );
/**
* Accessor for dpi used in scale calculations
* @return int the dpi used for scale calculations.
*/
int dpi();
double dpi();

/**
* Set the map units
Expand Down Expand Up @@ -84,7 +84,7 @@ class CORE_EXPORT QgsScaleCalculator
private:

//! dpi member
int mDpi;
double mDpi;

//! map unit member
QGis::units mMapUnits;
Expand Down

0 comments on commit 284902a

Please sign in to comment.