Skip to content
Permalink
Browse files

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.
  • Loading branch information
3nids committed Oct 25, 2018
1 parent 699d848 commit bf5537e230674b933d129662bbb9b32bc3d9f58f
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/gui/qgsmapcanvas.cpp
@@ -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

0 comments on commit bf5537e

Please sign in to comment.
You can’t perform that action at this time.