From e7a48f150a28e107da0f44045bdf68c26d5e2d31 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 18 May 2017 14:59:17 -0400 Subject: [PATCH] Remove clang warning Make the opening speed DPI scaling-dependent --- src/interaction/luaconsole.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index f816db5acc..a095b7e78d 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -575,8 +575,9 @@ void LuaConsole::update() { // The current height is the offset that is used to slide // the console in from the top. const glm::ivec2 res = OsEng.windowWrapper().currentWindowResolution(); + const glm::vec2 dpiScaling = OsEng.windowWrapper().dpiScaling(); _currentHeight += (_targetHeight - _currentHeight) * - std::pow(0.98, 1.0 / (ConsoleOpenSpeed * frametime)); + std::pow(0.98, 1.0 / (ConsoleOpenSpeed / dpiScaling.y * frametime)); _currentHeight = std::max(0.0f, _currentHeight); _currentHeight = std::min(static_cast(res.y), _currentHeight); @@ -669,7 +670,7 @@ void LuaConsole::render() { // @CPP17: Replace with array_view std::vector commandSubset; - if (_commandsHistory.size() < _historyLength) { + if (_commandsHistory.size() < static_cast(_historyLength)) { commandSubset = _commandsHistory; } else {