Skip to content
Permalink
Browse files

Use antialiasing to make sure the path is drawn without artifacts, dr…

…aw text using painter path too to avoid problems with buffer and text not being lined up correctly.

git-svn-id: http://svn.osgeo.org/qgis/branches/symbology-ng-branch@11314 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Aug 9, 2009
1 parent b03ae30 commit 6e6a970388c9b14dd072e7b5d12ab594366c952c
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/plugins/labeling/pallabeling.cpp
@@ -445,6 +445,8 @@ void PalLabeling::doLabeling(QPainter* painter, QgsRectangle extent)
std::cout << "LABELING work: " << t.elapsed() << "ms ... labels# " << labels->size() << std::endl;
t.restart();

painter->setRenderHint(QPainter::Antialiasing);

// draw the labels
std::list<LabelPosition*>::iterator it = labels->begin();
for ( ; it != labels->end(); ++it)
@@ -550,9 +552,15 @@ void PalLabeling::drawLabel( pal::LabelPosition* label, QPainter* painter, const
else
{
// we're drawing real label
painter->setFont( lyr.textFont );
/*painter->setFont( lyr.textFont );
painter->setPen( lyr.textColor );
painter->drawText(0,0, txt);
painter->drawText((0,0, txt);*/

QPainterPath path;
path.addText(0,0, lyr.textFont, text);
painter->setPen( Qt::NoPen );
painter->setBrush( lyr.textColor );
painter->drawPath(path);
}
painter->restore();

0 comments on commit 6e6a970

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