Skip to content

Commit

Permalink
[composer] Prevent data defined size of scalebar from being less than…
Browse files Browse the repository at this point in the history
… calculated minimum size
  • Loading branch information
nyalldawson committed Aug 11, 2014
1 parent ad799c8 commit 856341d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/core/composer/qgscomposerscalebar.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,19 @@ void QgsComposerScaleBar::adjustBoxSize()
QRectF box = mStyle->calculateBoxSize();

//update rect for data defined size and position
setSceneRect( evalItemRect( box ) );
QRectF newRect = evalItemRect( box );

//scale bars have a minimum size, respect that regardless of data defined settings
if ( newRect.width() < box.width() )
{
newRect.setWidth( box.width() );
}
if ( newRect.height() < box.height() )
{
newRect.setHeight( box.height() );
}

setSceneRect( newRect );
}

void QgsComposerScaleBar::update()
Expand Down

0 comments on commit 856341d

Please sign in to comment.