Skip to content

Commit b4e87d8

Browse files
committedOct 19, 2018
use float precision
1 parent 09d2260 commit b4e87d8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
 

‎python/core/auto_generated/qgsmapsettings.sip.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ Returns the size of the resulting map image
6060
Sets the size of the resulting map image
6161
%End
6262

63-
int devicePixelRatio() const;
63+
float devicePixelRatio() const;
6464
%Docstring
6565
Returns device pixel ratio
6666

6767
.. versionadded:: 3.4
6868
%End
6969

70-
void setDevicePixelRatio( int dpr );
70+
void setDevicePixelRatio( float dpr );
7171
%Docstring
7272
Sets the device pixel ratio
7373

‎src/core/qgsmapsettings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,12 @@ void QgsMapSettings::setOutputSize( QSize size )
230230
updateDerived();
231231
}
232232

233-
int QgsMapSettings::devicePixelRatio() const
233+
float QgsMapSettings::devicePixelRatio() const
234234
{
235235
return mDevicePixelRatio;
236236
}
237237

238-
void QgsMapSettings::setDevicePixelRatio( int dpr )
238+
void QgsMapSettings::setDevicePixelRatio( float dpr )
239239
{
240240
mDevicePixelRatio = dpr;
241241
}

‎src/core/qgsmapsettings.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ class CORE_EXPORT QgsMapSettings
8585
* Returns device pixel ratio
8686
* \since QGIS 3.4
8787
*/
88-
int devicePixelRatio() const;
88+
float devicePixelRatio() const;
8989

9090
/**
9191
* Sets the device pixel ratio
9292
* \since QGIS 3.4
9393
*/
94-
void setDevicePixelRatio( int dpr );
94+
void setDevicePixelRatio( float dpr );
9595

9696
/**
9797
* Returns the device output size of the map canvas
@@ -423,7 +423,7 @@ class CORE_EXPORT QgsMapSettings
423423
double mDpi;
424424

425425
QSize mSize;
426-
int mDevicePixelRatio = 1;
426+
float mDevicePixelRatio = 1.0;
427427

428428
QgsRectangle mExtent;
429429

0 commit comments

Comments
 (0)
Please sign in to comment.