Skip to content

Commit

Permalink
Fix clang tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 7, 2025
1 parent bb4060a commit 3032ee9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/core/effects/qgspainteffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ QImage QgsPaintEffect::sourceAsImage( QgsRenderContext &context )
//else create it
//TODO - test with premultiplied image for speed
const QRectF bounds = imageBoundingRect( context );
mSourceImage = QImage( bounds.width(), bounds.height(), QImage::Format_ARGB32 );
mSourceImage = QImage( static_cast< int >( std::ceil( bounds.width() ) ),
static_cast< int >( std::ceil( bounds.height() ) ), QImage::Format_ARGB32 );
mSourceImage.fill( Qt::transparent );
QPainter imagePainter( &mSourceImage );
imagePainter.setRenderHint( QPainter::Antialiasing );
Expand Down
4 changes: 2 additions & 2 deletions tests/src/core/testqgspainteffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ void TestQgsPaintEffect::stackSaveRestore()
void TestQgsPaintEffect::painterFlags()
{
QImage image( 100, 100, QImage::Format_ARGB32 );
image.setDotsPerMeterX( 96 / 25.4 * 1000 );
image.setDotsPerMeterY( 96 / 25.4 * 1000 );
image.setDotsPerMeterX( static_cast< int >( 96 / 25.4 * 1000 ) );
image.setDotsPerMeterY( static_cast< int >( 96 / 25.4 * 1000 ) );
image.fill( Qt::transparent );
QPainter painter;
painter.begin( &image );
Expand Down

0 comments on commit 3032ee9

Please sign in to comment.