[QGIS Commit] r9545 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Oct 25 09:02:21 EDT 2008


Author: mhugent
Date: 2008-10-25 09:02:21 -0400 (Sat, 25 Oct 2008)
New Revision: 9545

Modified:
   trunk/qgis/src/core/qgslabel.cpp
Log:
Fix for bug #1347, no label buffers in composer image output

Modified: trunk/qgis/src/core/qgslabel.cpp
===================================================================
--- trunk/qgis/src/core/qgslabel.cpp	2008-10-25 11:59:48 UTC (rev 9544)
+++ trunk/qgis/src/core/qgslabel.cpp	2008-10-25 13:02:21 UTC (rev 9545)
@@ -408,7 +408,7 @@
   //
   if ( mLabelAttributes->bufferSizeIsSet() && mLabelAttributes->bufferEnabled() )
   {
-    int myBufferSize = static_cast<int>( mLabelAttributes->bufferSize() * 0.3527 * sizeScale );
+    double myBufferSize = mLabelAttributes->bufferSize() * 0.3527 * sizeScale;
     QPen bufferPen;
     if ( mLabelAttributes->bufferColorIsSet() )
     {
@@ -427,12 +427,12 @@
     }
     else //draw more dense in case of logical devices
     {
-      bufferStepSize = 0.25;
+      bufferStepSize = 0.1;
     }
 
-    for ( double i = dx - myBufferSize; i <= dx + myBufferSize; i += 0.25 )
+    for ( double i = dx - myBufferSize; i <= dx + myBufferSize; i += bufferStepSize )
     {
-      for ( double j = dy - myBufferSize; j <= dy + myBufferSize; j += 0.25 )
+      for ( double j = dy - myBufferSize; j <= dy + myBufferSize; j += bufferStepSize )
       {
         if ( mLabelAttributes->multilineEnabled() )
           painter->drawText( QRectF( i, j - height, width, height ), alignment, text );



More information about the QGIS-commit mailing list