Browse Source

Platform: fix verbose log for app-specified DPI scaling.

It was printing 0 before, which isn't correct. Also why not print both
values? Printing just the first one would hide issues where the second
is accidentally 0 or some other wrong value.
pull/491/head
Vladimír Vondruš 5 years ago
parent
commit
03ca45bd0c
  1. 3
      doc/changelog.dox
  2. 4
      src/Magnum/Platform/EmscriptenApplication.cpp
  3. 4
      src/Magnum/Platform/GlfwApplication.cpp
  4. 4
      src/Magnum/Platform/Sdl2Application.cpp

3
doc/changelog.dox

@ -261,6 +261,9 @@ See also:
propagate errors when delegating to
@ref Text::AbstractFontConverter::exportFontToSingleData() /
@ref Text::AbstractFontConverter::exportGlyphCacheToSingleData()
- Fixed @ref Platform::GlfwApplication, @ref Platform::Sdl2Application and
@ref Platform::EmscriptenApplication to correctly print app-specified DPI
scaling in its verbose output
@subsection changelog-latest-deprecated Deprecated APIs

4
src/Magnum/Platform/EmscriptenApplication.cpp

@ -286,10 +286,10 @@ Vector2 EmscriptenApplication::dpiScaling(const Configuration& configuration) co
/* Use values from the configuration only if not overriden on command line.
In any case explicit scaling has a precedence before the policy. */
if(!_commandLineDpiScaling.isZero()) {
Debug{verbose} << "Platform::EmscriptenApplication: user-defined DPI scaling" << _commandLineDpiScaling.x();
Debug{verbose} << "Platform::EmscriptenApplication: user-defined DPI scaling" << _commandLineDpiScaling;
return _commandLineDpiScaling;
} else if(!configuration.dpiScaling().isZero()) {
Debug{verbose} << "Platform::EmscriptenApplication: app-defined DPI scaling" << _commandLineDpiScaling.x();
Debug{verbose} << "Platform::EmscriptenApplication: app-defined DPI scaling" << configuration.dpiScaling();
return configuration.dpiScaling();
}

4
src/Magnum/Platform/GlfwApplication.cpp

@ -151,12 +151,12 @@ Vector2 GlfwApplication::dpiScaling(const Configuration& configuration) {
before the policy. */
Implementation::GlfwDpiScalingPolicy dpiScalingPolicy{};
if(!_commandLineDpiScaling.isZero()) {
Debug{verbose} << "Platform::GlfwApplication: user-defined DPI scaling" << _commandLineDpiScaling.x();
Debug{verbose} << "Platform::GlfwApplication: user-defined DPI scaling" << _commandLineDpiScaling;
return _commandLineDpiScaling;
} else if(_commandLineDpiScalingPolicy != Implementation::GlfwDpiScalingPolicy::Default) {
dpiScalingPolicy = _commandLineDpiScalingPolicy;
} else if(!configuration.dpiScaling().isZero()) {
Debug{verbose} << "Platform::GlfwApplication: app-defined DPI scaling" << _commandLineDpiScaling.x();
Debug{verbose} << "Platform::GlfwApplication: app-defined DPI scaling" << configuration.dpiScaling();
return configuration.dpiScaling();
} else {
dpiScalingPolicy = configuration.dpiScalingPolicy();

4
src/Magnum/Platform/Sdl2Application.cpp

@ -211,12 +211,12 @@ Vector2 Sdl2Application::dpiScaling(const Configuration& configuration) {
before the policy. */
Implementation::Sdl2DpiScalingPolicy dpiScalingPolicy{};
if(!_commandLineDpiScaling.isZero()) {
Debug{verbose} << "Platform::Sdl2Application: user-defined DPI scaling" << _commandLineDpiScaling.x();
Debug{verbose} << "Platform::Sdl2Application: user-defined DPI scaling" << _commandLineDpiScaling;
return _commandLineDpiScaling;
} else if(_commandLineDpiScalingPolicy != Implementation::Sdl2DpiScalingPolicy::Default) {
dpiScalingPolicy = _commandLineDpiScalingPolicy;
} else if(!configuration.dpiScaling().isZero()) {
Debug{verbose} << "Platform::Sdl2Application: app-defined DPI scaling" << _commandLineDpiScaling.x();
Debug{verbose} << "Platform::Sdl2Application: app-defined DPI scaling" << configuration.dpiScaling();
return configuration.dpiScaling();
} else {
dpiScalingPolicy = configuration.dpiScalingPolicy();

Loading…
Cancel
Save