Skip to content

Commit

Permalink
always use double for dpi
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 28, 2016
1 parent cf99817 commit c3e7a56
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion python/core/qgsmaprenderer.sip
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsmapsettings.sip
Expand Up @@ -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 );


/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaprenderer.cpp
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaprenderer.h
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsmapsettings.cpp
Expand Up @@ -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;

Expand Down
5 changes: 2 additions & 3 deletions src/core/qgsmapsettings.h
Expand Up @@ -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
Expand Down

0 comments on commit c3e7a56

Please sign in to comment.