Skip to content
Permalink
Browse files

always use double for dpi

  • Loading branch information
3nids committed May 28, 2016
1 parent cf99817 commit c3e7a56b05e878cab9d1afec78be0f32e0875fcb
@@ -184,7 +184,7 @@ class QgsMapRenderer : QObject
//! sets whether map image will be for overview
void enableOverviewMode( bool isOverview = true );

void setOutputSize( QSize size, int dpi );
void setOutputSize( QSize size, double dpi );
void setOutputSize( QSizeF size, double dpi );

//!accessor for output dpi
@@ -35,9 +35,9 @@ class QgsMapSettings

//! Return DPI used for conversion between real world units (e.g. mm) and pixels
//! Default value is 96
int outputDpi() const;
double outputDpi() const;
//! Set DPI used for conversion between real world units (e.g. mm) and pixels
void setOutputDpi( int dpi );
void setOutputDpi( double dpi );


/**
@@ -138,7 +138,7 @@ double QgsMapRenderer::rotation() const
}


void QgsMapRenderer::setOutputSize( QSize size, int dpi )
void QgsMapRenderer::setOutputSize( QSize size, double dpi )
{
mSize = QSizeF( size.width(), size.height() );
mScaleCalculator->setDpi( dpi );
@@ -247,7 +247,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
//! sets whether map image will be for overview
void enableOverviewMode( bool isOverview = true ) { mOverview = isOverview; }

void setOutputSize( QSize size, int dpi );
void setOutputSize( QSize size, double dpi );
void setOutputSize( QSizeF size, double dpi );

//!accessor for output dpi
@@ -241,12 +241,12 @@ void QgsMapSettings::setOutputSize( QSize size )
updateDerived();
}

int QgsMapSettings::outputDpi() const
double QgsMapSettings::outputDpi() const
{
return ( int )mDpi;
return mDpi;
}

void QgsMapSettings::setOutputDpi( int dpi )
void QgsMapSettings::setOutputDpi( double dpi )
{
mDpi = dpi;

@@ -83,10 +83,9 @@ class CORE_EXPORT QgsMapSettings

//! Return DPI used for conversion between real world units (e.g. mm) and pixels
//! Default value is 96
//! TODO QGIS 3 return double ?
int outputDpi() const;
double outputDpi() const;
//! Set DPI used for conversion between real world units (e.g. mm) and pixels
void setOutputDpi( int dpi );
void setOutputDpi( double dpi );

/**
* @brief setMagnificationFactor set the magnification factor

0 comments on commit c3e7a56

Please sign in to comment.
You can’t perform that action at this time.