Skip to content
Permalink
Browse files

fix #1751

git-svn-id: http://svn.osgeo.org/qgis/trunk@10987 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jun 27, 2009
1 parent 29450dc commit 1166fbff62b4508ad0e36608df0a2d1a4378174a
Showing with 25 additions and 13 deletions.
  1. +24 −12 src/core/symbology/qgsmarkercatalogue.cpp
  2. +1 −1 src/core/symbology/qgsmarkercatalogue.h
@@ -145,6 +145,14 @@ QImage QgsMarkerCatalogue::imageMarker( QString fullName, double size, QPen pen,
//
// Now pass the paintdevice along to have the marker rendered on it
//
if ( fullName.left( 4 ) == "svg:" )
{
if ( svgMarker( &myPainter, fullName.mid( 4 ), size ) )
return myImage;

QgsDebugMsg( QString( "%1 not found - replacing with hard:circle" ).arg( fullName ) );
fullName = "hard:circle";
}

if ( fullName.left( 5 ) == "hard:" )
{
@@ -157,11 +165,7 @@ QImage QgsMarkerCatalogue::imageMarker( QString fullName, double size, QPen pen,
#endif
return myImage;
}
else if ( fullName.left( 4 ) == "svg:" )
{
svgMarker( &myPainter, fullName.mid( 4 ), size );
return myImage;
}

return QImage(); // empty
}

@@ -192,25 +196,33 @@ QPicture QgsMarkerCatalogue::pictureMarker( QString fullName, double size, QPen
//
// Now pass the paintdevice along to have the marker rndered on it
//
if ( fullName.left( 4 ) == "svg:" )
{
if ( svgMarker( &myPainter, fullName.mid( 4 ), size ) )
return myPicture;

QgsDebugMsg( QString( "%1 not found - replacing with hard:circle" ).arg( fullName ) );
fullName = "hard:circle";
}

if ( fullName.left( 5 ) == "hard:" )
{
hardMarker( &myPainter, ( int ) size, fullName.mid( 5 ), size, pen, brush, qtBug );
return myPicture;
}
else if ( fullName.left( 4 ) == "svg:" )
{
svgMarker( &myPainter, fullName.mid( 4 ), size );
return myPicture;
}

return QPicture(); // empty
}

void QgsMarkerCatalogue::svgMarker( QPainter * thepPainter, QString fileName, double scaleFactor )
bool QgsMarkerCatalogue::svgMarker( QPainter * thepPainter, QString fileName, double scaleFactor )
{
QSvgRenderer mySVG;
mySVG.load( fileName );
if ( !mySVG.load( fileName ) )
return false;

mySVG.render( thepPainter );

return true;
}

void QgsMarkerCatalogue::hardMarker( QPainter * thepPainter, int imageSize, QString name, double s, QPen pen, QBrush brush, bool qtBug )
@@ -52,7 +52,7 @@ class CORE_EXPORT QgsMarkerCatalogue

/** Returns a pixmap given a file name of a svg marker
* NOTE: this method needs to be public static for QgsMarkerDialog::visualizeMarkers */
static void svgMarker( QPainter * thepPainter, QString name, double size );
static bool svgMarker( QPainter * thepPainter, QString name, double size );
private:

/**Constructor*/

0 comments on commit 1166fbf

Please sign in to comment.
You can’t perform that action at this time.