mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
fix crash when changing screen while rendering (#8328)
remove this assert since by the time the map is rendered the screen changed and might not have the same DPR.
This commit is contained in:
parent
699d8487dc
commit
bf5537e230
@ -690,7 +690,13 @@ QgsRectangle QgsMapCanvas::imageRect( const QImage &img, const QgsMapSettings &m
|
||||
// expects (encoding of position and size of the item)
|
||||
const QgsMapToPixel &m2p = mapSettings.mapToPixel();
|
||||
QgsPointXY topLeft = m2p.toMapCoordinates( 0, 0 );
|
||||
Q_ASSERT( img.devicePixelRatio() == mapSettings.devicePixelRatio() );
|
||||
#ifdef QGISDEBUG
|
||||
// do not assert this, since it might lead to crashes when changing screen while rendering
|
||||
if ( img.devicePixelRatio() != mapSettings.devicePixelRatio() )
|
||||
{
|
||||
QgsLogger::warning( QStringLiteral( "The renderer map has a wrong device pixel ratio" ) );
|
||||
}
|
||||
#endif
|
||||
#if QT_VERSION >= 0x050600
|
||||
double res = m2p.mapUnitsPerPixel() / img.devicePixelRatioF();
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user