Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
3d/terrain: Improve debugging tile info visibility
The `show map tile info` option allows to display the tile information
of the terrain. However this info is not really visible because the
info is in the same color as the scene background (white) and the text
is too small.

This issue is fixed with the following changes:
- change the color to red
- make the text background opaque
- increase the text size
  • Loading branch information
ptitjano authored and nyalldawson committed May 11, 2023
1 parent cce4d2f commit 5805888
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/3d/terrain/qgsterraintexturegenerator_p.cpp
Expand Up @@ -109,7 +109,11 @@ void QgsTerrainTextureGenerator::waitForFinished()
{
// extra tile information for debugging
QPainter p( &img );
p.setPen( Qt::white );
p.setPen( Qt::red );
p.setBackgroundMode( Qt::OpaqueMode );
QFont font = p.font();
font.setPixelSize( std::max( 30, mMap.mapTileResolution() / 6 ) );
p.setFont( font );
p.drawRect( 0, 0, img.width() - 1, img.height() - 1 );
p.drawText( img.rect(), jobData.debugText, QTextOption( Qt::AlignCenter ) );
p.end();
Expand Down Expand Up @@ -139,7 +143,11 @@ void QgsTerrainTextureGenerator::onRenderingFinished()
{
// extra tile information for debugging
QPainter p( &img );
p.setPen( Qt::white );
p.setPen( Qt::red );
p.setBackgroundMode( Qt::OpaqueMode );
QFont font = p.font();
font.setPixelSize( std::max( 30, mMap.mapTileResolution() / 6 ) );
p.setFont( font );
p.drawRect( 0, 0, img.width() - 1, img.height() - 1 );
p.drawText( img.rect(), jobData.debugText, QTextOption( Qt::AlignCenter ) );
p.end();
Expand Down

0 comments on commit 5805888

Please sign in to comment.