Correctly set the height of the LuaConsole (closes #1375)

This commit is contained in:
Alexander Bock
2020-11-16 11:02:43 +01:00
parent ef081d27aa
commit 8d6fc92cbc

View File

@@ -600,7 +600,9 @@ void LuaConsole::update() {
// what the bounding box for that text would be.
using namespace ghoul::fontrendering;
const float height = _historyFont->height() * (_commandsHistory.size() + 1);
const float height =
_historyFont->height() *
(std::min(static_cast<int>(_commandsHistory.size()), _historyLength.value()) + 1);
// Update the full height and the target height.
// Add the height of the entry line and space for a separator.