Fixes #1186, keeping minimum size of 4

git-svn-id: http://svn.osgeo.org/qgis/trunk@9513 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
homann 2008-10-21 21:31:51 +00:00
parent 2dae372a89
commit 7c54dc07e2

View File

@ -100,6 +100,13 @@ QImage QgsMarkerCatalogue::imageMarker( QString fullName, double size, QPen pen,
//
// 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 @@ QImage QgsMarkerCatalogue::imageMarker( QString fullName, double size, QPen pen,
{
// 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 @@ void QgsMarkerCatalogue::hardMarker( QPainter * thepPainter, QString name, doubl
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)