[composer] Follow up 2b3108f9ae, fix calculation of bounding rect after resizing composer shapes

This commit is contained in:
Nyall Dawson 2014-04-11 12:33:52 +10:00
parent 9864bfc11b
commit bead88a828
2 changed files with 13 additions and 0 deletions

View File

@ -349,3 +349,11 @@ void QgsComposerShape::updateBoundingRect()
mCurrentRectangle = rectangle;
}
}
void QgsComposerShape::setSceneRect( const QRectF& rectangle )
{
// Reimplemented from QgsComposerItem as we need to call updateBoundingRect after the shape's size changes
QgsComposerItem::setSceneRect( rectangle );
updateBoundingRect();
update();
}

View File

@ -84,6 +84,11 @@ class CORE_EXPORT QgsComposerShape: public QgsComposerItem
@note this function was added in version 2.3*/
QRectF boundingRect() const;
/**Sets new scene rectangle bounds and recalculates hight and extent. Reimplemented from
* QgsComposerItem as it needs to call updateBoundingRect after the shape's size changes
*/
void setSceneRect( const QRectF& rectangle );
protected:
/* reimplement drawFrame, since it's not a rect, but a custom shape */
virtual void drawFrame( QPainter* p );