Skip to content

Commit

Permalink
Fix for SVG cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jun 27, 2013
1 parent 59222a0 commit 104b4d9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/symbology-ng/qgssvgcache.cpp
Expand Up @@ -136,7 +136,10 @@ const QImage& QgsSvgCache::svgAsImage( const QString& file, double size, const Q
//currentEntry->image = new QImage( 0, 0 );

// instead cache picture
cachePicture( currentEntry );
if ( !currentEntry->picture )
{
cachePicture( currentEntry );
}
}
else
{
Expand Down Expand Up @@ -693,6 +696,11 @@ void QgsSvgCache::printEntryList()

void QgsSvgCache::trimToMaximumSize()
{
//only one entry in cache
if ( mLeastRecentEntry == mMostRecentEntry )
{
return;
}
QgsSvgCacheEntry* entry = mLeastRecentEntry;
while ( entry && ( mTotalSize > mMaximumSize ) )
{
Expand Down

0 comments on commit 104b4d9

Please sign in to comment.