use float precision

This commit is contained in:
Denis Rouzaud 2018-10-19 10:07:05 -04:00
parent 09d2260b86
commit b4e87d873e
3 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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
@ -423,7 +423,7 @@ class CORE_EXPORT QgsMapSettings
double mDpi;
QSize mSize;
int mDevicePixelRatio = 1;
float mDevicePixelRatio = 1.0;
QgsRectangle mExtent;