Skip to content

Commit 6e6a970

Browse files
author
wonder
committedAug 9, 2009
Use antialiasing to make sure the path is drawn without artifacts, draw 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

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
 

‎src/plugins/labeling/pallabeling.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ void PalLabeling::doLabeling(QPainter* painter, QgsRectangle extent)
445445
std::cout << "LABELING work: " << t.elapsed() << "ms ... labels# " << labels->size() << std::endl;
446446
t.restart();
447447

448+
painter->setRenderHint(QPainter::Antialiasing);
449+
448450
// draw the labels
449451
std::list<LabelPosition*>::iterator it = labels->begin();
450452
for ( ; it != labels->end(); ++it)
@@ -550,9 +552,15 @@ void PalLabeling::drawLabel( pal::LabelPosition* label, QPainter* painter, const
550552
else
551553
{
552554
// we're drawing real label
553-
painter->setFont( lyr.textFont );
555+
/*painter->setFont( lyr.textFont );
554556
painter->setPen( lyr.textColor );
555-
painter->drawText(0,0, txt);
557+
painter->drawText((0,0, txt);*/
558+
559+
QPainterPath path;
560+
path.addText(0,0, lyr.textFont, text);
561+
painter->setPen( Qt::NoPen );
562+
painter->setBrush( lyr.textColor );
563+
painter->drawPath(path);
556564
}
557565
painter->restore();
558566

0 commit comments

Comments
 (0)
Please sign in to comment.