Skip to content

Commit

Permalink
use float precision
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Oct 19, 2018
1 parent 09d2260 commit b4e87d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python/core/auto_generated/qgsmapsettings.sip.in
Expand Up @@ -60,14 +60,14 @@ Returns the size of the resulting map image
Sets the size of the resulting map image
%End

int devicePixelRatio() const;
float devicePixelRatio() const;
%Docstring
Returns device pixel ratio

.. versionadded:: 3.4
%End

void setDevicePixelRatio( int dpr );
void setDevicePixelRatio( float dpr );
%Docstring
Sets the device pixel ratio

Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmapsettings.cpp
Expand Up @@ -230,12 +230,12 @@ void QgsMapSettings::setOutputSize( QSize size )
updateDerived();
}

int QgsMapSettings::devicePixelRatio() const
float QgsMapSettings::devicePixelRatio() const
{
return mDevicePixelRatio;
}

void QgsMapSettings::setDevicePixelRatio( int dpr )
void QgsMapSettings::setDevicePixelRatio( float dpr )
{
mDevicePixelRatio = dpr;
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsmapsettings.h
Expand Up @@ -85,13 +85,13 @@ class CORE_EXPORT QgsMapSettings
* Returns device pixel ratio
* \since QGIS 3.4
*/
int devicePixelRatio() const;
float devicePixelRatio() const;

/**
* Sets the device pixel ratio
* \since QGIS 3.4
*/
void setDevicePixelRatio( int dpr );
void setDevicePixelRatio( float dpr );

/**
* Returns the device output size of the map canvas
Expand Down Expand Up @@ -423,7 +423,7 @@ class CORE_EXPORT QgsMapSettings
double mDpi;

QSize mSize;
int mDevicePixelRatio = 1;
float mDevicePixelRatio = 1.0;

QgsRectangle mExtent;

Expand Down

0 comments on commit b4e87d8

Please sign in to comment.