File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ void QgsComposerPicture::setSceneRect( const QRectF& rectangle )
364
364
365
365
QRectF newRect = rectangle;
366
366
367
- if ( mResizeMode == ZoomResizeFrame && !rect ().isEmpty () )
367
+ if ( mResizeMode == ZoomResizeFrame && !rect ().isEmpty () && !( currentPictureSize. isEmpty () ) )
368
368
{
369
369
// if width has changed less than height, then fix width and set height correspondingly
370
370
// else, do the opposite
@@ -380,8 +380,11 @@ void QgsComposerPicture::setSceneRect( const QRectF& rectangle )
380
380
}
381
381
else if ( mResizeMode == FrameToImageSize )
382
382
{
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
+ }
385
388
}
386
389
387
390
// find largest scaling of picture with this rotation which fits in item
You can’t perform that action at this time.
0 commit comments