Skip to content

Commit

Permalink
When checking for a label cache image, we only look for those which
Browse files Browse the repository at this point in the history
would be drawn between 30% and 300% of their original image size

We don't want to draw massive pixelated labels on top of everything
else, and we also don't need to draw tiny unreadable labels... better
to draw nothing in this case and wait till the updated label results
are ready!
  • Loading branch information
nyalldawson committed Jan 28, 2021
1 parent 339516a commit a290537
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/qgsmaprendererjob.cpp
Expand Up @@ -819,7 +819,10 @@ QImage QgsMapRendererJob::composeImage(
painter.setOpacity( 1.0 );
painter.drawImage( 0, 0, *labelJob.img );
}
else if ( cache && cache->hasAnyCacheImage( LABEL_PREVIEW_CACHE_ID ) )
// when checking for a label cache image, we only look for those which would be drawn between 30% and 300% of the
// original size. We don't want to draw massive pixelated labels on top of everything else, and we also don't need
// to draw tiny unreadable labels... better to draw nothing in this case and wait till the updated label results are ready!
else if ( cache && cache->hasAnyCacheImage( LABEL_PREVIEW_CACHE_ID, 0.3, 3 ) )
{
const QImage labelCacheImage = cache->transformedCacheImage( LABEL_PREVIEW_CACHE_ID, settings.mapToPixel() );
painter.setCompositionMode( QPainter::CompositionMode_SourceOver );
Expand Down

0 comments on commit a290537

Please sign in to comment.