Skip to content

Commit

Permalink
Remove unused private code (#58125)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson authored Jul 16, 2024
1 parent e9c2569 commit 531d5a6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
34 changes: 0 additions & 34 deletions src/core/layout/qgslayoutitempicture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,40 +608,6 @@ void QgsLayoutItemPicture::loadPicture( const QVariant &data )
emit changed();
}

QRectF QgsLayoutItemPicture::boundedImageRect( double deviceWidth, double deviceHeight )
{
double imageToDeviceRatio;
if ( mImage.width() / deviceWidth > mImage.height() / deviceHeight )
{
imageToDeviceRatio = deviceWidth / mImage.width();
const double height = imageToDeviceRatio * mImage.height();
return QRectF( 0, 0, deviceWidth, height );
}
else
{
imageToDeviceRatio = deviceHeight / mImage.height();
const double width = imageToDeviceRatio * mImage.width();
return QRectF( 0, 0, width, deviceHeight );
}
}

QRectF QgsLayoutItemPicture::boundedSVGRect( double deviceWidth, double deviceHeight )
{
double imageToSvgRatio;
if ( deviceWidth / mDefaultSvgSize.width() > deviceHeight / mDefaultSvgSize.height() )
{
imageToSvgRatio = deviceHeight / mDefaultSvgSize.height();
const double width = mDefaultSvgSize.width() * imageToSvgRatio;
return QRectF( 0, 0, width, deviceHeight );
}
else
{
imageToSvgRatio = deviceWidth / mDefaultSvgSize.width();
const double height = mDefaultSvgSize.height() * imageToSvgRatio;
return QRectF( 0, 0, deviceWidth, height );
}
}

QSizeF QgsLayoutItemPicture::pictureSize()
{
if ( mMode == FormatSVG )
Expand Down
5 changes: 0 additions & 5 deletions src/core/layout/qgslayoutitempicture.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,6 @@ class CORE_EXPORT QgsLayoutItemPicture: public QgsLayoutItem

QgsLayoutItemPicture() = delete;

//! Calculates bounding rect for svg file (mSourcefile) such that aspect ratio is correct
QRectF boundedSVGRect( double deviceWidth, double deviceHeight );
//! Calculates bounding rect for image such that aspect ratio is correct
QRectF boundedImageRect( double deviceWidth, double deviceHeight );

//! Returns size of current raster or svg picture
QSizeF pictureSize();

Expand Down

0 comments on commit 531d5a6

Please sign in to comment.