Skip to content
Permalink
Browse files

[composer] Don't resize picture frame to invalid sizes (sponsored by …

…City of Uster, Switzerland)
  • Loading branch information
nyalldawson committed Apr 28, 2014
1 parent 021da60 commit 5c8cd77151f1e0a86b4ada448db99cce1156e43f
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/core/composer/qgscomposerpicture.cpp
@@ -364,7 +364,7 @@ void QgsComposerPicture::setSceneRect( const QRectF& rectangle )

QRectF newRect = rectangle;

if ( mResizeMode == ZoomResizeFrame && !rect().isEmpty() )
if ( mResizeMode == ZoomResizeFrame && !rect().isEmpty() && !( currentPictureSize.isEmpty() ) )
{
//if width has changed less than height, then fix width and set height correspondingly
//else, do the opposite
@@ -380,8 +380,11 @@ void QgsComposerPicture::setSceneRect( const QRectF& rectangle )
}
else if ( mResizeMode == FrameToImageSize )
{
newRect.setWidth( currentPictureSize.width() * 25.4 / mComposition->printResolution() );
newRect.setHeight( currentPictureSize.height() * 25.4 / mComposition->printResolution() );
if ( !( currentPictureSize.isEmpty() ) )
{
newRect.setWidth( currentPictureSize.width() * 25.4 / mComposition->printResolution() );
newRect.setHeight( currentPictureSize.height() * 25.4 / mComposition->printResolution() );
}
}

//find largest scaling of picture with this rotation which fits in item

0 comments on commit 5c8cd77

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