Skip to content

Commit 09d2260

Browse files
committedOct 19, 2018
rename physicalSize to deviceOutputSize
1 parent 924e375 commit 09d2260

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed
 

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ Sets the device pixel ratio
7474
.. versionadded:: 3.4
7575
%End
7676

77-
QSize physicalSize() const;
77+
QSize deviceOutputSize() const;
7878
%Docstring
79-
Returns the physical size of the map canvas
79+
Returns the device output size of the map canvas
8080
This is equivalent to the output size multiplicated
81-
by the device pixel ratio
81+
by the device pixel ratio.
8282

8383
.. versionadded:: 3.4
8484
%End

‎src/core/qgsmaprenderercustompainterjob.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void QgsMapRendererCustomPainterJob::start()
6060
prepareTime.start();
6161

6262
// clear the background
63-
mPainter->fillRect( 0, 0, mSettings.physicalSize().width(), mSettings.physicalSize().height(), mSettings.backgroundColor() );
63+
mPainter->fillRect( 0, 0, mSettings.deviceOutputSize().width(), mSettings.deviceOutputSize().height(), mSettings.backgroundColor() );
6464

6565
mPainter->setRenderHint( QPainter::Antialiasing, mSettings.testFlag( QgsMapSettings::Antialiasing ) );
6666

‎src/core/qgsmaprendererjob.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter *painter, QgsLabelingEn
325325
if ( mCache || !painter || needTemporaryImage( ml ) )
326326
{
327327
// Flattened image for drawing when a blending mode is set
328-
QImage *mypFlattenedImage = new QImage( mSettings.physicalSize(),
328+
QImage *mypFlattenedImage = new QImage( mSettings.deviceOutputSize(),
329329
mSettings.outputImageFormat() );
330330
mypFlattenedImage->setDevicePixelRatio( mSettings.devicePixelRatio() );
331331
if ( mypFlattenedImage->isNull() )
@@ -375,7 +375,7 @@ LabelRenderJob QgsMapRendererJob::prepareLabelingJob( QPainter *painter, QgsLabe
375375
{
376376
// Flattened image for drawing labels
377377
QImage *mypFlattenedImage = nullptr;
378-
mypFlattenedImage = new QImage( mSettings.physicalSize(),
378+
mypFlattenedImage = new QImage( mSettings.deviceOutputSize(),
379379
mSettings.outputImageFormat() );
380380
mypFlattenedImage->setDevicePixelRatio( mSettings.devicePixelRatio() );
381381
if ( mypFlattenedImage->isNull() )
@@ -448,7 +448,7 @@ void QgsMapRendererJob::cleanupLabelJob( LabelRenderJob &job )
448448

449449
QImage QgsMapRendererJob::composeImage( const QgsMapSettings &settings, const LayerRenderJobs &jobs, const LabelRenderJob &labelJob )
450450
{
451-
QImage image( settings.physicalSize(), settings.outputImageFormat() );
451+
QImage image( settings.deviceOutputSize(), settings.outputImageFormat() );
452452
image.setDevicePixelRatio( settings.devicePixelRatio() );
453453
image.fill( settings.backgroundColor().rgba() );
454454

‎src/core/qgsmaprenderersequentialjob.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ QgsMapRendererSequentialJob::QgsMapRendererSequentialJob( const QgsMapSettings &
2525
{
2626
QgsDebugMsgLevel( QStringLiteral( "SEQUENTIAL construct" ), 5 );
2727

28-
mImage = QImage( mSettings.physicalSize(), mSettings.outputImageFormat() );
28+
mImage = QImage( mSettings.deviceOutputSize(), mSettings.outputImageFormat() );
2929
mImage.setDevicePixelRatio( mSettings.devicePixelRatio() );
3030
mImage.setDotsPerMeterX( 1000 * settings.outputDpi() / 25.4 );
3131
mImage.setDotsPerMeterY( 1000 * settings.outputDpi() / 25.4 );

‎src/core/qgsmapsettings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void QgsMapSettings::setDevicePixelRatio( int dpr )
240240
mDevicePixelRatio = dpr;
241241
}
242242

243-
QSize QgsMapSettings::physicalSize() const
243+
QSize QgsMapSettings::deviceOutputSize() const
244244
{
245245
return outputSize() * mDevicePixelRatio;
246246
}

‎src/core/qgsmapsettings.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ class CORE_EXPORT QgsMapSettings
9494
void setDevicePixelRatio( int dpr );
9595

9696
/**
97-
* Returns the physical size of the map canvas
97+
* Returns the device output size of the map canvas
9898
* This is equivalent to the output size multiplicated
99-
* by the device pixel ratio
99+
* by the device pixel ratio.
100100
* \since QGIS 3.4
101101
*/
102-
QSize physicalSize() const;
102+
QSize deviceOutputSize() const;
103103

104104
/**
105105
* Returns the rotation of the resulting map image, in degrees clockwise.

0 commit comments

Comments
 (0)
Please sign in to comment.