Skip to content
Permalink
Browse files
Remove canvasPolygon() helper function
Because it doesn't do enough for an extra function to make sense here.
This also gets rid of an unused variable.
  • Loading branch information
joto authored and nyalldawson committed Oct 23, 2021
1 parent e4b611d commit b27190fabed942ae8995f7d989416253055481f5
Showing with 2 additions and 8 deletions.
  1. +2 −8 src/app/decorations/qgsdecorationgrid.cpp
@@ -375,12 +375,6 @@ void QgsDecorationGrid::drawCoordinateAnnotation( QgsRenderContext &context, QPo
QgsTextRenderer::drawText( QPointF( xpos, ypos ), rotation, QgsTextRenderer::AlignLeft, annotationStringList, context, mTextFormat );
}

QPolygonF canvasPolygon( const QgsMapSettings &mapSettings )
{
const QPolygonF poly;
return mapSettings.visiblePolygon();
}

bool clipByRect( QLineF &line, const QPolygonF &rect )
{
QVector<QLineF> borderLines;
@@ -441,7 +435,7 @@ int QgsDecorationGrid::xGridLines( const QgsMapSettings &mapSettings, QList< QPa
if ( mGridIntervalY / mapSettings.mapUnitsPerPixel() < 1 )
return 1;

const QPolygonF canvasPoly = canvasPolygon( mapSettings );
const QPolygonF canvasPoly = mapSettings.visiblePolygon();
const QPolygonF mapPolygon = canvasExtent( mapSettings );
const QRectF mapBoundingRect = mapPolygon.boundingRect();
const QLineF lineEast( mapPolygon[2], mapPolygon[1] );
@@ -486,7 +480,7 @@ int QgsDecorationGrid::yGridLines( const QgsMapSettings &mapSettings, QList< QPa
if ( mGridIntervalX / mapSettings.mapUnitsPerPixel() < 1 )
return 1;

const QPolygonF canvasPoly = canvasPolygon( mapSettings );
const QPolygonF canvasPoly = mapSettings.visiblePolygon();
const QPolygonF mapPolygon = canvasExtent( mapSettings );
const QLineF lineSouth( mapPolygon[3], mapPolygon[2] );
const QLineF lineNorth( mapPolygon[0], mapPolygon[1] );

0 comments on commit b27190f

Please sign in to comment.