Skip to content
Permalink
Browse files

Revert print scale fix.

Use Marco Hugentobler's print scale fix. It's cleaner
  • Loading branch information
m-kuhn committed Aug 31, 2012
1 parent 83b4caa commit 573d57ff69304ca1a4e99b82b2784ade6f4368e4
@@ -30,17 +30,6 @@ void QgsDiagram::setPenWidth( QPen& pen, const QgsDiagramSettings& s, const QgsR
}
}

QSizeF QgsDiagram::sizeForPAL( const QSizeF& size, const QgsDiagramSettings& s, const QgsRenderContext& c )
{
if ( s.sizeType == QgsDiagramSettings::MM )
{
return QSizeF( size.width() / c.rasterScaleFactor(), size.height() / c.rasterScaleFactor() );
}
else
{
return QSizeF( size );
}
}

QSizeF QgsDiagram::sizePainterUnits( const QSizeF& size, const QgsDiagramSettings& s, const QgsRenderContext& c )
{
@@ -44,7 +44,6 @@ class CORE_EXPORT QgsDiagram
protected:
void setPenWidth( QPen& pen, const QgsDiagramSettings& s, const QgsRenderContext& c );
QSizeF sizePainterUnits( const QSizeF& size, const QgsDiagramSettings& s, const QgsRenderContext& c );
QSizeF sizeForPAL( const QSizeF& size, const QgsDiagramSettings& s, const QgsRenderContext& c );
float sizePainterUnits( float l, const QgsDiagramSettings& s, const QgsRenderContext& c );
QFont scaledFont( const QgsDiagramSettings& s, const QgsRenderContext& c );
};
@@ -67,8 +67,7 @@ QSizeF QgsHistogramDiagram::diagramSize( const QgsAttributeMap& attributes, cons
break;
}

QSizeF scaledSize = sizeForPAL( size, s, c );
return scaledSize;
return size;
}

QSizeF QgsHistogramDiagram::diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s )
@@ -104,8 +103,7 @@ QSizeF QgsHistogramDiagram::diagramSize( const QgsAttributeMap& attributes, cons
break;
}

QSizeF scaledSize = sizeForPAL( size, s, c );
return scaledSize;
return size;
}

void QgsHistogramDiagram::renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position )
@@ -69,14 +69,12 @@ QSizeF QgsPieDiagram::diagramSize( const QgsAttributeMap& attributes, const QgsR
size.scale( s.minimumSize, s.minimumSize, Qt::KeepAspectRatio );
}

QSizeF scaledSize = sizeForPAL( size, s, c );
return scaledSize;
return size;
}

QSizeF QgsPieDiagram::diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s )
{
QSizeF scaledSize = sizeForPAL( s.size, s, c );
return scaledSize;
return s.size;
}

int QgsPieDiagram::sCount = 0;
@@ -70,14 +70,12 @@ QSizeF QgsTextDiagram::diagramSize( const QgsAttributeMap& attributes, const Qgs
size.scale( s.minimumSize, s.minimumSize, Qt::KeepAspectRatio );
}

QSizeF scaledSize = sizeForPAL( size, s, c );
return scaledSize;
return size;
}

QSizeF QgsTextDiagram::diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s )
{
QSizeF scaledSize = sizeForPAL( s.size, s, c );
return scaledSize;
return s.size;
}

void QgsTextDiagram::renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position )

0 comments on commit 573d57f

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