From bead88a82862dfff1abb5d264db238ce2f7f0f37 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 11 Apr 2014 12:33:52 +1000 Subject: [PATCH] [composer] Follow up 2b3108f9ae, fix calculation of bounding rect after resizing composer shapes --- src/core/composer/qgscomposershape.cpp | 8 ++++++++ src/core/composer/qgscomposershape.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/core/composer/qgscomposershape.cpp b/src/core/composer/qgscomposershape.cpp index 4b1deca0e95..fdaef94a413 100755 --- a/src/core/composer/qgscomposershape.cpp +++ b/src/core/composer/qgscomposershape.cpp @@ -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(); +} diff --git a/src/core/composer/qgscomposershape.h b/src/core/composer/qgscomposershape.h index 44f349ea7a9..d246d33c0be 100755 --- a/src/core/composer/qgscomposershape.h +++ b/src/core/composer/qgscomposershape.h @@ -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 );