[QGIS Commit] r11314 - branches/symbology-ng-branch/src/plugins/labeling

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Aug 9 08:49:18 EDT 2009


Author: wonder
Date: 2009-08-09 08:49:18 -0400 (Sun, 09 Aug 2009)
New Revision: 11314

Modified:
   branches/symbology-ng-branch/src/plugins/labeling/pallabeling.cpp
Log:
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.


Modified: branches/symbology-ng-branch/src/plugins/labeling/pallabeling.cpp
===================================================================
--- branches/symbology-ng-branch/src/plugins/labeling/pallabeling.cpp	2009-08-09 12:08:31 UTC (rev 11313)
+++ branches/symbology-ng-branch/src/plugins/labeling/pallabeling.cpp	2009-08-09 12:49:18 UTC (rev 11314)
@@ -445,6 +445,8 @@
   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 @@
   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();
 



More information about the QGIS-commit mailing list