mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
Fix infinite loop when painting grid with bad parameters
Credit to @m-kuhn
This commit is contained in:
parent
9170b992b1
commit
4876c6572c
@ -1651,6 +1651,9 @@ int QgsComposerMapGrid::xGridLinesCRSTransform( const QgsRectangle& bbox, const
|
||||
step = ( maxX + 360.0 - minX ) / 20;
|
||||
}
|
||||
|
||||
if ( step == 0 )
|
||||
return 1;
|
||||
|
||||
int gridLineCount = 0;
|
||||
while ( currentLevel >= bbox.yMinimum() && gridLineCount < MAX_GRID_LINES )
|
||||
{
|
||||
@ -1714,6 +1717,9 @@ int QgsComposerMapGrid::yGridLinesCRSTransform( const QgsRectangle& bbox, const
|
||||
double maxY = bbox.yMaximum();
|
||||
double step = ( maxY - minY ) / 20;
|
||||
|
||||
if ( step == 0 )
|
||||
return 1;
|
||||
|
||||
bool crosses180 = false;
|
||||
bool crossed180 = false;
|
||||
if ( mCRS.geographicFlag() && ( bbox.xMinimum() > bbox.xMaximum() ) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user