mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
rename physicalSize to deviceOutputSize
This commit is contained in:
parent
924e375f48
commit
09d2260b86
@ -74,11 +74,11 @@ Sets the device pixel ratio
|
|||||||
.. versionadded:: 3.4
|
.. versionadded:: 3.4
|
||||||
%End
|
%End
|
||||||
|
|
||||||
QSize physicalSize() const;
|
QSize deviceOutputSize() const;
|
||||||
%Docstring
|
%Docstring
|
||||||
Returns the physical size of the map canvas
|
Returns the device output size of the map canvas
|
||||||
This is equivalent to the output size multiplicated
|
This is equivalent to the output size multiplicated
|
||||||
by the device pixel ratio
|
by the device pixel ratio.
|
||||||
|
|
||||||
.. versionadded:: 3.4
|
.. versionadded:: 3.4
|
||||||
%End
|
%End
|
||||||
|
@ -60,7 +60,7 @@ void QgsMapRendererCustomPainterJob::start()
|
|||||||
prepareTime.start();
|
prepareTime.start();
|
||||||
|
|
||||||
// clear the background
|
// clear the background
|
||||||
mPainter->fillRect( 0, 0, mSettings.physicalSize().width(), mSettings.physicalSize().height(), mSettings.backgroundColor() );
|
mPainter->fillRect( 0, 0, mSettings.deviceOutputSize().width(), mSettings.deviceOutputSize().height(), mSettings.backgroundColor() );
|
||||||
|
|
||||||
mPainter->setRenderHint( QPainter::Antialiasing, mSettings.testFlag( QgsMapSettings::Antialiasing ) );
|
mPainter->setRenderHint( QPainter::Antialiasing, mSettings.testFlag( QgsMapSettings::Antialiasing ) );
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter *painter, QgsLabelingEn
|
|||||||
if ( mCache || !painter || needTemporaryImage( ml ) )
|
if ( mCache || !painter || needTemporaryImage( ml ) )
|
||||||
{
|
{
|
||||||
// Flattened image for drawing when a blending mode is set
|
// Flattened image for drawing when a blending mode is set
|
||||||
QImage *mypFlattenedImage = new QImage( mSettings.physicalSize(),
|
QImage *mypFlattenedImage = new QImage( mSettings.deviceOutputSize(),
|
||||||
mSettings.outputImageFormat() );
|
mSettings.outputImageFormat() );
|
||||||
mypFlattenedImage->setDevicePixelRatio( mSettings.devicePixelRatio() );
|
mypFlattenedImage->setDevicePixelRatio( mSettings.devicePixelRatio() );
|
||||||
if ( mypFlattenedImage->isNull() )
|
if ( mypFlattenedImage->isNull() )
|
||||||
@ -375,7 +375,7 @@ LabelRenderJob QgsMapRendererJob::prepareLabelingJob( QPainter *painter, QgsLabe
|
|||||||
{
|
{
|
||||||
// Flattened image for drawing labels
|
// Flattened image for drawing labels
|
||||||
QImage *mypFlattenedImage = nullptr;
|
QImage *mypFlattenedImage = nullptr;
|
||||||
mypFlattenedImage = new QImage( mSettings.physicalSize(),
|
mypFlattenedImage = new QImage( mSettings.deviceOutputSize(),
|
||||||
mSettings.outputImageFormat() );
|
mSettings.outputImageFormat() );
|
||||||
mypFlattenedImage->setDevicePixelRatio( mSettings.devicePixelRatio() );
|
mypFlattenedImage->setDevicePixelRatio( mSettings.devicePixelRatio() );
|
||||||
if ( mypFlattenedImage->isNull() )
|
if ( mypFlattenedImage->isNull() )
|
||||||
@ -448,7 +448,7 @@ void QgsMapRendererJob::cleanupLabelJob( LabelRenderJob &job )
|
|||||||
|
|
||||||
QImage QgsMapRendererJob::composeImage( const QgsMapSettings &settings, const LayerRenderJobs &jobs, const LabelRenderJob &labelJob )
|
QImage QgsMapRendererJob::composeImage( const QgsMapSettings &settings, const LayerRenderJobs &jobs, const LabelRenderJob &labelJob )
|
||||||
{
|
{
|
||||||
QImage image( settings.physicalSize(), settings.outputImageFormat() );
|
QImage image( settings.deviceOutputSize(), settings.outputImageFormat() );
|
||||||
image.setDevicePixelRatio( settings.devicePixelRatio() );
|
image.setDevicePixelRatio( settings.devicePixelRatio() );
|
||||||
image.fill( settings.backgroundColor().rgba() );
|
image.fill( settings.backgroundColor().rgba() );
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ QgsMapRendererSequentialJob::QgsMapRendererSequentialJob( const QgsMapSettings &
|
|||||||
{
|
{
|
||||||
QgsDebugMsgLevel( QStringLiteral( "SEQUENTIAL construct" ), 5 );
|
QgsDebugMsgLevel( QStringLiteral( "SEQUENTIAL construct" ), 5 );
|
||||||
|
|
||||||
mImage = QImage( mSettings.physicalSize(), mSettings.outputImageFormat() );
|
mImage = QImage( mSettings.deviceOutputSize(), mSettings.outputImageFormat() );
|
||||||
mImage.setDevicePixelRatio( mSettings.devicePixelRatio() );
|
mImage.setDevicePixelRatio( mSettings.devicePixelRatio() );
|
||||||
mImage.setDotsPerMeterX( 1000 * settings.outputDpi() / 25.4 );
|
mImage.setDotsPerMeterX( 1000 * settings.outputDpi() / 25.4 );
|
||||||
mImage.setDotsPerMeterY( 1000 * settings.outputDpi() / 25.4 );
|
mImage.setDotsPerMeterY( 1000 * settings.outputDpi() / 25.4 );
|
||||||
|
@ -240,7 +240,7 @@ void QgsMapSettings::setDevicePixelRatio( int dpr )
|
|||||||
mDevicePixelRatio = dpr;
|
mDevicePixelRatio = dpr;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize QgsMapSettings::physicalSize() const
|
QSize QgsMapSettings::deviceOutputSize() const
|
||||||
{
|
{
|
||||||
return outputSize() * mDevicePixelRatio;
|
return outputSize() * mDevicePixelRatio;
|
||||||
}
|
}
|
||||||
|
@ -94,12 +94,12 @@ class CORE_EXPORT QgsMapSettings
|
|||||||
void setDevicePixelRatio( int dpr );
|
void setDevicePixelRatio( int dpr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the physical size of the map canvas
|
* Returns the device output size of the map canvas
|
||||||
* This is equivalent to the output size multiplicated
|
* This is equivalent to the output size multiplicated
|
||||||
* by the device pixel ratio
|
* by the device pixel ratio.
|
||||||
* \since QGIS 3.4
|
* \since QGIS 3.4
|
||||||
*/
|
*/
|
||||||
QSize physicalSize() const;
|
QSize deviceOutputSize() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the rotation of the resulting map image, in degrees clockwise.
|
* Returns the rotation of the resulting map image, in degrees clockwise.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user