Skip to content

Commit

Permalink
3D views: use the correct resolution on high DPI displays!
Browse files Browse the repository at this point in the history
Nowadays Qt gives us size in device independent pixels, and we were
using those values for the textures as well - but that means on high DPI
screens where device pixel ratio is 2, we were rendering in low resolution
and then upscaling the textures. This should fix that, and intermediate
textures use the correct size - the rendered output is much crispier, yay!
  • Loading branch information
wonder-sk authored and nyalldawson committed Jan 28, 2025
1 parent 3ac14b5 commit a4f33d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/3d/qgswindow3dengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void QgsWindow3DEngine::setSize( QSize s )

mMapCanvas3D->setWidth( mSize.width() );
mMapCanvas3D->setHeight( mSize.height() );
mFrameGraph->setSize( mSize );
mFrameGraph->setSize( mSize * mMapCanvas3D->devicePixelRatio() );
camera()->setAspectRatio( float( mSize.width() ) / float( mSize.height() ) );
emit sizeChanged();
}

0 comments on commit a4f33d4

Please sign in to comment.