Skip to content

Commit

Permalink
Consider view box of svg pictures in composer, set default frame widt…
Browse files Browse the repository at this point in the history
…h to 0.3

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9344 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 17, 2008
1 parent 4682fc8 commit 4da2454
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/composer/qgscomposeritem.cpp
Expand Up @@ -37,7 +37,7 @@ QgsComposerItem::QgsComposerItem( QgsComposition* composition ): QGraphicsRectIt
//set default pen and brush
setBrush( QBrush( QColor( 255, 255, 255, 255 ) ) );
QPen defaultPen( QColor( 0, 0, 0 ) );
defaultPen.setWidth( 1 );
defaultPen.setWidthF( 0.3 );
setPen( defaultPen );

//let z-Value be managed by composition
Expand All @@ -59,7 +59,7 @@ QgsComposerItem::QgsComposerItem( qreal x, qreal y, qreal width, qreal height, Q
//set default pen and brush
setBrush( QBrush( QColor( 255, 255, 255, 255 ) ) );
QPen defaultPen( QColor( 0, 0, 0 ) );
defaultPen.setWidth( 1 );
defaultPen.setWidthF( 0.3 );
setPen( defaultPen );

//let z-Value be managed by composition
Expand Down
5 changes: 4 additions & 1 deletion src/core/composer/qgscomposerpicture.cpp
Expand Up @@ -110,7 +110,9 @@ void QgsComposerPicture::setPictureFile( const QString& path )
if ( validTestRenderer.isValid() )
{
mMode = SVG;
mDefaultSvgSize = validTestRenderer.defaultSize();
QRect viewBox = validTestRenderer.viewBox(); //take width/height ratio from view box instead of default size
mDefaultSvgSize.setWidth(viewBox.width());
mDefaultSvgSize.setHeight(viewBox.height());
mSvgCacheUpToDate = false;
}
else
Expand Down Expand Up @@ -138,6 +140,7 @@ void QgsComposerPicture::updateImageFromSvg()
{
mImage.fill( 0 );
QPainter p( &mImage );
p.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing, true);
QSvgRenderer theRenderer( mSourceFile.fileName() );
if ( theRenderer.isValid() )
{
Expand Down

0 comments on commit 4da2454

Please sign in to comment.