File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ void QgsComposerPicture::setSceneRect( const QRectF& rectangle )
364364
365365 QRectF newRect = rectangle;
366366
367- if ( mResizeMode == ZoomResizeFrame && !rect ().isEmpty () )
367+ if ( mResizeMode == ZoomResizeFrame && !rect ().isEmpty () && !( currentPictureSize. isEmpty () ) )
368368 {
369369 // if width has changed less than height, then fix width and set height correspondingly
370370 // else, do the opposite
@@ -380,8 +380,11 @@ void QgsComposerPicture::setSceneRect( const QRectF& rectangle )
380380 }
381381 else if ( mResizeMode == FrameToImageSize )
382382 {
383- newRect.setWidth ( currentPictureSize.width () * 25.4 / mComposition ->printResolution () );
384- newRect.setHeight ( currentPictureSize.height () * 25.4 / mComposition ->printResolution () );
383+ if ( !( currentPictureSize.isEmpty () ) )
384+ {
385+ newRect.setWidth ( currentPictureSize.width () * 25.4 / mComposition ->printResolution () );
386+ newRect.setHeight ( currentPictureSize.height () * 25.4 / mComposition ->printResolution () );
387+ }
385388 }
386389
387390 // find largest scaling of picture with this rotation which fits in item
You can’t perform that action at this time.
0 commit comments