Skip to content

Commit 03f5d71

Browse files
author
rblazek
committedFeb 15, 2006
antialiasing
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4862 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 778f179 commit 03f5d71

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed
 

‎src/plugins/grass/qgsgrassmodule.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ QPixmap QgsGrassModule::pixmap ( QString path, int height )
508508
QPixmap pixmap ( width, height );
509509
pixmap.fill ( QColor(255,255,255) );
510510
QPainter painter ( &pixmap );
511+
painter.setRenderHint(QPainter::Antialiasing);
511512

512513
// I am not sure if this factor is OK
513514
scale *= 72.0 / pixmap.logicalDpiX() ;
@@ -559,28 +560,31 @@ QPixmap QgsGrassModule::pixmap ( QString path, int height )
559560
pixmap.fill(QColor(255,255,255));
560561
QPainter painter ( &pixmap );
561562

562-
QPen pen(QColor(180,180,180),3);
563-
painter.setPen(pen);
563+
QColor color(200,200,200);
564+
painter.setBrush(QBrush(color));
564565

565-
QBrush brush(QColor(180,180,180));
566-
painter.setBrush(brush);
566+
painter.setRenderHint(QPainter::Antialiasing);
567567

568568
int pos = 0;
569569
for ( int i = 0; i < pixmaps.size(); i++ ) {
570570
if ( i == 1 && pixmaps.size() == 3 ) { // +
571571
pos += buffer;
572-
painter.drawLine ( pos, height/2, pos+plusWidth+1, height/2 );
573-
painter.drawLine ( pos+plusWidth/2, height/2-plusWidth/2, pos+plusWidth/2, height/2+plusWidth/2+1 );
572+
573+
painter.setPen( QPen(color,3) );
574+
painter.drawLine ( pos, height/2, pos+plusWidth, height/2 );
575+
painter.drawLine ( pos+plusWidth/2, height/2-plusWidth/2, pos+plusWidth/2, height/2+plusWidth/2 );
574576
pos += buffer + plusWidth;
575577
}
576578
if ( (i == 1 && pixmaps.size() == 2) || (i == 2 && pixmaps.size() == 3) ) { // ->
577579
pos += buffer;
578-
painter.drawLine ( pos, height/2, pos+arrowWidth, height/2 );
580+
painter.setPen( QPen(color,3) );
581+
painter.drawLine ( pos, height/2, pos+arrowWidth-arrowWidth/2, height/2 );
579582

580583
Q3PointArray pa(3);
581-
pa.setPoint(0, pos+arrowWidth/2+1, height/2-arrowWidth/4);
584+
pa.setPoint(0, pos+arrowWidth/2+1, height/2-arrowWidth/2);
582585
pa.setPoint(1, pos+arrowWidth, height/2 );
583-
pa.setPoint(2, pos+arrowWidth/2+1, height/2+arrowWidth/4);
586+
pa.setPoint(2, pos+arrowWidth/2+1, height/2+arrowWidth/2);
587+
painter.setPen( QPen(color,1) );
584588
painter.drawPolygon ( pa );
585589

586590
pos += buffer + arrowWidth;

0 commit comments

Comments
 (0)
Please sign in to comment.