Skip to content

Commit

Permalink
Followup c04a540
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 13, 2014
1 parent c04a540 commit 8be42a0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/composer/qgscomposermapgrid.cpp
Expand Up @@ -970,7 +970,8 @@ int QgsComposerMapGrid::xGridLinesCRSTransform( const QgsRectangle& bbox, const
double maxX = bbox.xMaximum();
double step = ( maxX - minX ) / 20;

while ( currentLevel >= bbox.yMinimum() )
int gridLineCount = 0;
while ( currentLevel >= bbox.yMinimum() && gridLineCount < MAX_GRID_LINES )
{
QPolygonF gridLine;
double currentX = minX;
Expand All @@ -991,6 +992,7 @@ int QgsComposerMapGrid::xGridLinesCRSTransform( const QgsRectangle& bbox, const
if ( gridLine.size() > 0 )
{
lines.append( qMakePair( currentLevel, gridLine ) );
gridLineCount++;
}
currentLevel -= mGridIntervalY;
}
Expand All @@ -1013,7 +1015,8 @@ int QgsComposerMapGrid::yGridLinesCRSTransform( const QgsRectangle& bbox, const
double maxY = bbox.yMaximum();
double step = ( maxY - minY ) / 20;

while ( currentLevel <= bbox.xMaximum() )
int gridLineCount = 0;
while ( currentLevel <= bbox.xMaximum() && gridLineCount < MAX_GRID_LINES )
{
QPolygonF gridLine;
double currentY = minY;
Expand All @@ -1035,6 +1038,7 @@ int QgsComposerMapGrid::yGridLinesCRSTransform( const QgsRectangle& bbox, const
if ( gridLine.size() > 0 )
{
lines.append( qMakePair( currentLevel, gridLine ) );
gridLineCount++;
}
currentLevel += mGridIntervalX;
}
Expand Down

0 comments on commit 8be42a0

Please sign in to comment.