Skip to content

Commit aa31c8c

Browse files
committedSep 3, 2012
sizePainterUnits: Calculate based on specified size instead of size in QgsDiagramSettings
1 parent 9c4d67c commit aa31c8c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed
 

‎src/core/diagram/qgsdiagram.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ void QgsDiagram::setPenWidth( QPen& pen, const QgsDiagramSettings& s, const QgsR
3333

3434
QSizeF QgsDiagram::sizePainterUnits( const QSizeF& size, const QgsDiagramSettings& s, const QgsRenderContext& c )
3535
{
36-
Q_UNUSED( size );
3736
if ( s.sizeType == QgsDiagramSettings::MM )
3837
{
39-
return QSizeF( s.size.width() * c.scaleFactor() * c.rasterScaleFactor(), s.size.height() * c.scaleFactor() * c.rasterScaleFactor());
38+
return QSizeF( size.width() * c.scaleFactor() * c.rasterScaleFactor(), size.height() * c.scaleFactor() * c.rasterScaleFactor());
4039
}
4140
else
4241
{
43-
return QSizeF( s.size.width() / c.mapToPixel().mapUnitsPerPixel(), s.size.height() / c.mapToPixel().mapUnitsPerPixel() );
42+
return QSizeF( size.width() / c.mapToPixel().mapUnitsPerPixel(), size.height() / c.mapToPixel().mapUnitsPerPixel() );
4443
}
4544
}
4645

‎src/core/diagram/qgsdiagram.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class CORE_EXPORT QgsDiagram
5050
void setPenWidth( QPen& pen, const QgsDiagramSettings& s, const QgsRenderContext& c );
5151

5252
/** Calculates a size to match the current settings and rendering context
53-
* @param size Unused
54-
* @param s The settings that specify the diagram size
53+
* @param size The size to convert
54+
* @param s The settings that specify the size type
5555
* @param c The rendering specifying the proper scale units for pixel conversion
5656
*
5757
* @return The converted size for rendering

0 commit comments

Comments
 (0)
Please sign in to comment.