mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Allow dpi values to be doubles. This fixes unprecise scale bars in composer
git-svn-id: http://svn.osgeo.org/qgis/trunk@9298 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
4a49d3dcbd
commit
284902a37d
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
@ -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
|
||||
@ -84,7 +84,7 @@ class CORE_EXPORT QgsScaleCalculator
|
||||
private:
|
||||
|
||||
//! dpi member
|
||||
int mDpi;
|
||||
double mDpi;
|
||||
|
||||
//! map unit member
|
||||
QGis::units mMapUnits;
|
||||
|
Loading…
x
Reference in New Issue
Block a user