Skip to content
Permalink
Browse files

Save settings for scaling small diagrams

  • Loading branch information
m-kuhn committed Aug 9, 2012
1 parent fc66a97 commit 0594725f875e41cf0fb2fc23806b9400294f6e50
Showing with 5 additions and 3 deletions.
  1. +4 −2 src/core/qgsdiagramrendererv2.cpp
  2. +1 −1 src/core/qgsdiagramrendererv2.h
@@ -75,6 +75,7 @@ void QgsDiagramSettings::readXML( const QDomElement& elem )
labelPlacementMethod = XHeight;
}

minimumSize = elem.attribute( "minimumSize" ).toDouble();

//colors
categoryColors.clear();
@@ -125,6 +126,7 @@ void QgsDiagramSettings::writeXML( QDomElement& rendererElem, QDomDocument& doc
categoryElem.setAttribute( "labelPlacementMethod", "XHeight" );
}

categoryElem.setAttribute( "minimumSize", QString::number( minimumSize ) );

QString colors;
for ( int i = 0; i < categoryColors.size(); ++i )
@@ -347,9 +349,9 @@ QSizeF QgsLinearlyInterpolatedDiagramRenderer::diagramSize( const QgsAttributeMa
mUpperSize.height() * ratio + mLowerSize.height() * ( 1 - ratio ) );

// Scale, if extension is smaller than the specified minimum
if ( size.width() <= mSettings.mMinimumSize && size.height() <= mSettings.mMinimumSize )
if ( size.width() <= mSettings.minimumSize && size.height() <= mSettings.minimumSize )
{
size.scale( mSettings.mMinimumSize, mSettings.mMinimumSize, Qt::KeepAspectRatio );
size.scale( mSettings.minimumSize, mSettings.minimumSize, Qt::KeepAspectRatio );
}

return size;
@@ -119,7 +119,7 @@ struct CORE_EXPORT QgsDiagramSettings
double maxScaleDenominator;

//! Scale diagrams smaller than mMinimumSize to mMinimumSize
double mMinimumSize;
double minimumSize;

void readXML( const QDomElement& elem );
void writeXML( QDomElement& rendererElem, QDomDocument& doc ) const;

0 comments on commit 0594725

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