diff options
author | Zeno- <kde.psych@gmail.com> | 2017-01-29 19:26:00 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-29 19:26:00 +1000 |
commit | 707e27b5c26b6c082abbd2f385a976c5bc8964fe (patch) | |
tree | 6d3e84e178221bda1c03fe402f9fa08b20a773a8 /src/guiChatConsole.cpp | |
parent | 3eecc6ff4492ca21772544451fd8aa78871bac3b (diff) | |
download | minetest-707e27b5c26b6c082abbd2f385a976c5bc8964fe.tar.gz minetest-707e27b5c26b6c082abbd2f385a976c5bc8964fe.tar.bz2 minetest-707e27b5c26b6c082abbd2f385a976c5bc8964fe.zip |
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.
Diffstat (limited to 'src/guiChatConsole.cpp')
-rw-r--r-- | src/guiChatConsole.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/guiChatConsole.cpp b/src/guiChatConsole.cpp index 867576175..bea5571f4 100644 --- a/src/guiChatConsole.cpp +++ b/src/guiChatConsole.cpp @@ -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); |