Skip to content

Commit c3e7a56

Browse files
committed
always use double for dpi
1 parent cf99817 commit c3e7a56

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

python/core/qgsmaprenderer.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class QgsMapRenderer : QObject
184184
//! sets whether map image will be for overview
185185
void enableOverviewMode( bool isOverview = true );
186186

187-
void setOutputSize( QSize size, int dpi );
187+
void setOutputSize( QSize size, double dpi );
188188
void setOutputSize( QSizeF size, double dpi );
189189

190190
//!accessor for output dpi

python/core/qgsmapsettings.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class QgsMapSettings
3535

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

4242

4343
/**

src/core/qgsmaprenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ double QgsMapRenderer::rotation() const
138138
}
139139

140140

141-
void QgsMapRenderer::setOutputSize( QSize size, int dpi )
141+
void QgsMapRenderer::setOutputSize( QSize size, double dpi )
142142
{
143143
mSize = QSizeF( size.width(), size.height() );
144144
mScaleCalculator->setDpi( dpi );

src/core/qgsmaprenderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
247247
//! sets whether map image will be for overview
248248
void enableOverviewMode( bool isOverview = true ) { mOverview = isOverview; }
249249

250-
void setOutputSize( QSize size, int dpi );
250+
void setOutputSize( QSize size, double dpi );
251251
void setOutputSize( QSizeF size, double dpi );
252252

253253
//!accessor for output dpi

src/core/qgsmapsettings.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,12 @@ void QgsMapSettings::setOutputSize( QSize size )
241241
updateDerived();
242242
}
243243

244-
int QgsMapSettings::outputDpi() const
244+
double QgsMapSettings::outputDpi() const
245245
{
246-
return ( int )mDpi;
246+
return mDpi;
247247
}
248248

249-
void QgsMapSettings::setOutputDpi( int dpi )
249+
void QgsMapSettings::setOutputDpi( double dpi )
250250
{
251251
mDpi = dpi;
252252

src/core/qgsmapsettings.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,9 @@ class CORE_EXPORT QgsMapSettings
8383

8484
//! Return DPI used for conversion between real world units (e.g. mm) and pixels
8585
//! Default value is 96
86-
//! TODO QGIS 3 return double ?
87-
int outputDpi() const;
86+
double outputDpi() const;
8887
//! Set DPI used for conversion between real world units (e.g. mm) and pixels
89-
void setOutputDpi( int dpi );
88+
void setOutputDpi( double dpi );
9089

9190
/**
9291
* @brief setMagnificationFactor set the magnification factor

0 commit comments

Comments
 (0)