[QGIS Commit] r9513 - trunk/qgis/src/core/symbology

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Oct 21 17:31:51 EDT 2008


Author: homann
Date: 2008-10-21 17:31:51 -0400 (Tue, 21 Oct 2008)
New Revision: 9513

Modified:
   trunk/qgis/src/core/symbology/qgsmarkercatalogue.cpp
Log:
Fixes #1186, keeping minimum size of 4

Modified: trunk/qgis/src/core/symbology/qgsmarkercatalogue.cpp
===================================================================
--- trunk/qgis/src/core/symbology/qgsmarkercatalogue.cpp	2008-10-21 19:27:41 UTC (rev 9512)
+++ trunk/qgis/src/core/symbology/qgsmarkercatalogue.cpp	2008-10-21 21:31:51 UTC (rev 9513)
@@ -100,6 +100,13 @@
   //
   // First prepare the paintdevice that the marker will be drawn onto
   //
+
+  // Introduce a minimum size, we don't want it to disappear.
+  if ( size < 4 )
+  {
+    size = 4;
+  }
+    
   QImage myImage;
   if ( fullName.left( 5 ) == "hard:" )
   {
@@ -109,7 +116,6 @@
   {
     // TODO Change this logic so width is size and height is same
     // proportion of scale factor as in oritignal SVG TS XXX
-    if ( size < 1 ) size = 1;
     //QPixmap myPixmap = QPixmap(width,height);
     myImage = QImage( size, size, QImage::Format_ARGB32_Premultiplied );
   }
@@ -218,7 +224,8 @@
   int r = ( s - 2 * lw ) / 2 - 1;
   QgsDebugMsg( QString( "Hard marker radius %1" ).arg( r ) );
 
-  if ( name == "circle" )
+  // If radius is 0, draw a circle, so it wont disappear.
+  if ( name == "circle" || r < 1)
   {
     // "A stroked ellipse has a size of rectangle.size() plus the pen width."
     // (from Qt doc)



More information about the QGIS-commit mailing list