Skip to content

Commit

Permalink
libappfw|BaseGuiApp: "-dpi" option overrides detected DPI factor
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Nov 13, 2014
1 parent b1f0f69 commit 27503bc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions doomsday/libappfw/src/baseguiapp.cpp
Expand Up @@ -104,12 +104,21 @@ BaseGuiApp::BaseGuiApp(int &argc, char **argv)
void BaseGuiApp::initSubsystems(SubsystemInitFlags flags)
{
GuiApp::initSubsystems(flags);

double dpiFactor = 1.0;

#ifdef DENG2_QT_5_0_OR_NEWER
// The device pixel ratio.
scriptSystem().nativeModule("DisplayMode").set("DPI_FACTOR", devicePixelRatio());
dpiFactor = devicePixelRatio();
#endif

// The "-dpi" option overrides the detected DPI factor.
if(auto dpi = commandLine().check("-dpi", 1))
{
dpiFactor = dpi.params.at(0).toDouble();
}

scriptSystem().nativeModule("DisplayMode").set("DPI_FACTOR", dpiFactor);

d->uiState.reset(new PersistentState("UIState"));
}

Expand Down

0 comments on commit 27503bc

Please sign in to comment.