Skip to content
Permalink
Browse files

Fix for missing left line in composer grid (happend with negative lef…

…t boundary coords). Fixes ticket #2458

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12963 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Feb 22, 2010
1 parent d9a151f commit c724ca757801887b6b38eb1cb40aa4f1738f3e43
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/core/composer/qgscomposermap.cpp
@@ -1042,9 +1042,13 @@ int QgsComposerMap::xGridLines( QList< QPair< double, QLineF > >& lines ) const
return 1;
}


QPolygonF mapPolygon = transformedMapPolygon();
QRectF mapBoundingRect = mapPolygon.boundingRect();
double currentLevel = ( int )(( mapBoundingRect.top() - mGridOffsetY ) / mGridIntervalY + 1.0 ) * mGridIntervalY + mGridOffsetY;

//consider to round up to the next step in case the left boundary is > 0
double roundCorrection = mapBoundingRect.top() > 0 ? 1.0 : 0.0;
double currentLevel = ( int )(( mapBoundingRect.top() - mGridOffsetY ) / mGridIntervalY + roundCorrection ) * mGridIntervalY + mGridOffsetY;

if ( mRotation <= 0.0 )
{
@@ -1109,7 +1113,10 @@ int QgsComposerMap::yGridLines( QList< QPair< double, QLineF > >& lines ) const

QPolygonF mapPolygon = transformedMapPolygon();
QRectF mapBoundingRect = mapPolygon.boundingRect();
double currentLevel = ( int )(( mapBoundingRect.left() - mGridOffsetX ) / mGridIntervalX + 1.0 ) * mGridIntervalX + mGridOffsetX;

//consider to round up to the next step in case the left boundary is > 0
double roundCorrection = mapBoundingRect.left() > 0 ? 1.0 : 0.0;
double currentLevel = ( int )(( mapBoundingRect.left() - mGridOffsetX ) / mGridIntervalX + roundCorrection ) * mGridIntervalX + mGridOffsetX;

if ( mRotation <= 0.0 )
{

0 comments on commit c724ca7

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