mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -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
|
||||
%End
|
||||
|
||||
QSize physicalSize() const;
|
||||
QSize deviceOutputSize() const;
|
||||
%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
|
||||
by the device pixel ratio
|
||||
by the device pixel ratio.
|
||||
|
||||
.. versionadded:: 3.4
|
||||
%End
|
||||
|
@ -60,7 +60,7 @@ void QgsMapRendererCustomPainterJob::start()
|
||||
prepareTime.start();
|
||||
|
||||
// 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 ) );
|
||||
|
||||
|
@ -325,7 +325,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter *painter, QgsLabelingEn
|
||||
if ( mCache || !painter || needTemporaryImage( ml ) )
|
||||
{
|
||||
// Flattened image for drawing when a blending mode is set
|
||||
QImage *mypFlattenedImage = new QImage( mSettings.physicalSize(),
|
||||
QImage *mypFlattenedImage = new QImage( mSettings.deviceOutputSize(),
|
||||
mSettings.outputImageFormat() );
|
||||
mypFlattenedImage->setDevicePixelRatio( mSettings.devicePixelRatio() );
|
||||
if ( mypFlattenedImage->isNull() )
|
||||
@ -375,7 +375,7 @@ LabelRenderJob QgsMapRendererJob::prepareLabelingJob( QPainter *painter, QgsLabe
|
||||
{
|
||||
// Flattened image for drawing labels
|
||||
QImage *mypFlattenedImage = nullptr;
|
||||
mypFlattenedImage = new QImage( mSettings.physicalSize(),
|
||||
mypFlattenedImage = new QImage( mSettings.deviceOutputSize(),
|
||||
mSettings.outputImageFormat() );
|
||||
mypFlattenedImage->setDevicePixelRatio( mSettings.devicePixelRatio() );
|
||||
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 image( settings.physicalSize(), settings.outputImageFormat() );
|
||||
QImage image( settings.deviceOutputSize(), settings.outputImageFormat() );
|
||||
image.setDevicePixelRatio( settings.devicePixelRatio() );
|
||||
image.fill( settings.backgroundColor().rgba() );
|
||||
|
||||
|
@ -25,7 +25,7 @@ QgsMapRendererSequentialJob::QgsMapRendererSequentialJob( const QgsMapSettings &
|
||||
{
|
||||
QgsDebugMsgLevel( QStringLiteral( "SEQUENTIAL construct" ), 5 );
|
||||
|
||||
mImage = QImage( mSettings.physicalSize(), mSettings.outputImageFormat() );
|
||||
mImage = QImage( mSettings.deviceOutputSize(), mSettings.outputImageFormat() );
|
||||
mImage.setDevicePixelRatio( mSettings.devicePixelRatio() );
|
||||
mImage.setDotsPerMeterX( 1000 * settings.outputDpi() / 25.4 );
|
||||
mImage.setDotsPerMeterY( 1000 * settings.outputDpi() / 25.4 );
|
||||
|
@ -240,7 +240,7 @@ void QgsMapSettings::setDevicePixelRatio( int dpr )
|
||||
mDevicePixelRatio = dpr;
|
||||
}
|
||||
|
||||
QSize QgsMapSettings::physicalSize() const
|
||||
QSize QgsMapSettings::deviceOutputSize() const
|
||||
{
|
||||
return outputSize() * mDevicePixelRatio;
|
||||
}
|
||||
|
@ -94,12 +94,12 @@ class CORE_EXPORT QgsMapSettings
|
||||
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
|
||||
* by the device pixel ratio
|
||||
* by the device pixel ratio.
|
||||
* \since QGIS 3.4
|
||||
*/
|
||||
QSize physicalSize() const;
|
||||
QSize deviceOutputSize() const;
|
||||
|
||||
/**
|
||||
* Returns the rotation of the resulting map image, in degrees clockwise.
|
||||
|
Loading…
x
Reference in New Issue
Block a user