@@ -1541,6 +1541,9 @@ void QgsComposerMap::drawGrid( QPainter* p )
1541
1541
1542
1542
void QgsComposerMap::drawGridFrame ( QPainter* p, const QList< QPair< double , QLineF > >& hLines, const QList< QPair< double , QLineF > >& vLines )
1543
1543
{
1544
+ p->save ();
1545
+ p->setRenderHint ( QPainter::Antialiasing );
1546
+
1544
1547
// Sort the coordinate positions for each side
1545
1548
QMap< double , double > leftGridFrame;
1546
1549
QMap< double , double > rightGridFrame;
@@ -1553,6 +1556,8 @@ void QgsComposerMap::drawGridFrame( QPainter* p, const QList< QPair< double, QLi
1553
1556
drawGridFrameBorder ( p, rightGridFrame, QgsComposerMap::Right );
1554
1557
drawGridFrameBorder ( p, topGridFrame, QgsComposerMap::Top );
1555
1558
drawGridFrameBorder ( p, bottomGridFrame, QgsComposerMap::Bottom );
1559
+
1560
+ p->restore ();
1556
1561
}
1557
1562
1558
1563
void QgsComposerMap::drawGridLine ( const QLineF& line, QgsRenderContext& context )
@@ -1632,6 +1637,8 @@ void QgsComposerMap::drawCoordinateAnnotations( QPainter* p, const QList< QPair<
1632
1637
return ;
1633
1638
}
1634
1639
1640
+ p->save ();
1641
+ p->setRenderHint ( QPainter::Antialiasing );
1635
1642
1636
1643
QString currentAnnotationString;
1637
1644
QList< QPair< double , QLineF > >::const_iterator it = hLines.constBegin ();
@@ -1649,6 +1656,7 @@ void QgsComposerMap::drawCoordinateAnnotations( QPainter* p, const QList< QPair<
1649
1656
drawCoordinateAnnotation ( p, it->second .p1 (), currentAnnotationString );
1650
1657
drawCoordinateAnnotation ( p, it->second .p2 (), currentAnnotationString );
1651
1658
}
1659
+ p->restore ();
1652
1660
}
1653
1661
1654
1662
void QgsComposerMap::drawCoordinateAnnotation ( QPainter* p, const QPointF& pos, QString annotationString )
@@ -2368,6 +2376,7 @@ void QgsComposerMap::drawCanvasItem( QGraphicsItem* item, QPainter* painter, con
2368
2376
}
2369
2377
2370
2378
painter->save ();
2379
+ painter->setRenderHint ( QPainter::Antialiasing );
2371
2380
2372
2381
// determine scale factor according to graphics view dpi
2373
2382
double scaleFactor = 1.0 / mMapCanvas ->logicalDpiX () * 25.4 ;
@@ -2392,7 +2401,6 @@ void QgsComposerMap::drawCanvasItem( QGraphicsItem* item, QPainter* painter, con
2392
2401
}
2393
2402
painter->translate ( itemX, itemY );
2394
2403
2395
-
2396
2404
painter->scale ( scaleFactor, scaleFactor );
2397
2405
2398
2406
// a little trick to let the item know that the paint request comes from the composer
0 commit comments