Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix clang tidy warning
  • Loading branch information
nyalldawson committed Jan 27, 2023
1 parent 4cf399f commit 3e657ae
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/core/layout/qgslayoutitemelevationprofile.cpp
Expand Up @@ -560,15 +560,14 @@ void QgsLayoutItemElevationProfile::paint( QPainter *painter, const QStyleOption
painter->setFont( messageFont );
painter->setPen( QColor( 255, 255, 255, 255 ) );
painter->drawText( thisPaintRect, Qt::AlignCenter | Qt::AlignHCenter, tr( "Rendering profile" ) );
if ( mRenderJob && mCacheInvalidated && !mDrawingPreview )
{
// current job was invalidated - start a new one
mPreviewScaleFactor = QgsLayoutUtils::scaleFactorFromItemStyle( itemStyle, painter );
mBackgroundUpdateTimer->start( 1 );
}
else if ( !mRenderJob && !mDrawingPreview )

if (
( mRenderJob && mCacheInvalidated && !mDrawingPreview ) // current job was invalidated - start a new one
||
( !mRenderJob && !mDrawingPreview ) // this is the profiles's very first paint - trigger a cache update
)
{
// this is the profiles's very first paint - trigger a cache update

mPreviewScaleFactor = QgsLayoutUtils::scaleFactorFromItemStyle( itemStyle, painter );
mBackgroundUpdateTimer->start( 1 );
}
Expand Down

0 comments on commit 3e657ae

Please sign in to comment.