Skip to content

Commit

Permalink
Get rid of artifacts behind hard markers drawn using qpicture
Browse files Browse the repository at this point in the history
Note tehre is still some scaling issue with these that I am looking into


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4724 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jan 23, 2006
1 parent 5f2fb16 commit e352e48
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/qgsmarkercatalogue.cpp
Expand Up @@ -90,6 +90,7 @@ QPixmap QgsMarkerCatalogue::marker ( QString fullName, int size, QPen pen, QBrus
if ( fullName.left(5) == "hard:" ) {
QPicture myPicture = hardMarker ( fullName.mid(5), size, pen, brush, qtBug );
QPixmap myPixmap = QPixmap (myPicture.width(),myPicture.height());
myPixmap.fill(QColor(255,255,255,0)); //transparent
QPainter myPainter(&myPixmap);
myPainter.drawPicture(0,0,myPicture);
return myPixmap;
Expand Down Expand Up @@ -126,6 +127,7 @@ QPicture QgsMarkerCatalogue::hardMarker ( QString name, int s, QPen pen, QBrush
// Picture
QPainter picpainter;
picpainter.begin(&picture);
picpainter.setRenderHint(QPainter::Antialiasing);

// Also width must be odd otherwise there are discrepancies visible in canvas!
int lw = (int)(2*floor((double)pen.width()/2)+1); // -> lw > 0
Expand Down

0 comments on commit e352e48

Please sign in to comment.