Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Save settings for scaling small diagrams
- Loading branch information
Showing
with
5 additions
and
3 deletions.
-
+4
−2
src/core/qgsdiagramrendererv2.cpp
-
+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; |
|
|