void QgsComposerShape::setSceneRect( const QRectF& rectangle ) { //consider to change size of the shape if the rectangle changes width and/or height if ( rectangle.width() != rect().width() || rectangle.height() != rect().height() ) { double newShapeWidth = rectangle.width(); double newShapeHeight = rectangle.height(); imageSizeConsideringRotation( newShapeWidth, newShapeHeight ); } QgsComposerItem::setSceneRect( rectangle ); }
void QgsComposerPicture::setSceneRect( const QRectF& rectangle ) { QgsComposerItem::setSceneRect( rectangle ); //consider to change size of the shape if the rectangle changes width and/or height double newPictureWidth = rectangle.width(); double newPictureHeight = rectangle.height(); imageSizeConsideringRotation( newPictureWidth, newPictureHeight ); mPictureWidth = newPictureWidth; mPictureHeight = newPictureHeight; emit itemChanged(); }
bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height ) const { //kept for api compatibility with QGIS 2.0, use item rotation return imageSizeConsideringRotation( width, height, mItemRotation ); }