1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Rename height to scale for openConsole() (#5139)

For Game::openConsole() and GUIChatConsole::openConsole() the
parameter name 'height' is misleading because it's actually a
percentage of the screen/window height.
This commit is contained in:
Zeno- 2017-01-29 19:26:00 +10:00 committed by GitHub
parent 3eecc6ff44
commit 707e27b5c2
3 changed files with 11 additions and 7 deletions

View file

@ -116,11 +116,13 @@ GUIChatConsole::~GUIChatConsole()
m_font->drop();
}
void GUIChatConsole::openConsole(f32 height)
void GUIChatConsole::openConsole(f32 scale)
{
assert(scale > 0.0f && scale <= 1.0f);
m_open = true;
m_desired_height_fraction = height;
m_desired_height = height * m_screensize.Y;
m_desired_height_fraction = scale;
m_desired_height = scale * m_screensize.Y;
reformatConsole();
m_animate_time_old = getTimeMs();
IGUIElement::setVisible(true);