コード例 #1
0
ファイル: qgscomposershape.cpp プロジェクト: DoctorGana/QGIS
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 );
}
コード例 #2
0
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();
}
コード例 #3
0
bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& height ) const
{
  //kept for api compatibility with QGIS 2.0, use item rotation
  return imageSizeConsideringRotation( width, height, mItemRotation );
}