Beispiel #1
0
void QgsComposerShape::setRotation( double r )
{
  //adapt rectangle size
  double width = rect().width();
  double height = rect().height();
  sizeChangedByRotation( width, height );

  //adapt scene rect to have the same center and the new width / height
  double x = pos().x() + rect().width() / 2.0 - width / 2.0;
  double y = pos().y() + rect().height() / 2.0 - height / 2.0;
  QgsComposerItem::setSceneRect( QRectF( x, y, width, height ) );

  QgsComposerItem::setRotation( r );
}
void QgsComposerItem::sizeChangedByRotation( double& width, double& height )
{
  //kept for api compatibility with QGIS 2.0, use item rotation
  return sizeChangedByRotation( width, height, mItemRotation );
}