Skip to content

Commit 734e0fc

Browse files
committed
Recreate viewport effect on screen scaling change
Fixes #4591
1 parent c01a1ad commit 734e0fc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/StelApp.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,13 +1424,17 @@ void StelApp::quit()
14241424
void StelApp::setDevicePixelsPerPixel(qreal dppp)
14251425
{
14261426
// Check that the device-independent pixel size didn't change
1427-
if (!viewportEffect && !fuzzyEquals(devicePixelsPerPixel, dppp))
1427+
if (!fuzzyEquals(devicePixelsPerPixel, dppp))
14281428
{
14291429
qDebug() << "Changing high-DPI scaling factor from" << devicePixelsPerPixel << "to" << dppp;
1430+
const auto effect = getViewportEffect();
1431+
setViewportEffect("none");
14301432
devicePixelsPerPixel = dppp;
14311433
StelProjector::StelProjectorParams params = core->getCurrentStelProjectorParams();
14321434
params.devicePixelsPerPixel = devicePixelsPerPixel;
14331435
core->setCurrentStelProjectorParams(params);
1436+
// Force to recreate the viewport effect if any.
1437+
setViewportEffect(effect);
14341438
}
14351439
}
14361440

0 commit comments

Comments
 (0)