aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2016-05-20 21:18:59 +1000
committerCraig Robbins <kde.psych@gmail.com>2016-05-21 00:26:04 +1000
commit88acda02567d586820867059718cac551dc7a58b (patch)
treec9a4b1acdeca3d7de18a95335797ade1145b0e08 /src
parent8ba6d9f227398d2004d1fe7ae095f5e342dc6d7b (diff)
downloadminetest-88acda02567d586820867059718cac551dc7a58b.tar.gz
minetest-88acda02567d586820867059718cac551dc7a58b.tar.bz2
minetest-88acda02567d586820867059718cac551dc7a58b.zip
Fix tooltip height for versions of irrlicht < 1.8.2
Version 1.8.2 of irrlicht changed the way that IGUIStaticText::getTextHeight() works and since that release properly deals with newlines. From irrlicht changes.txt for 1.8.2, "IGUIStaticText::getTextHeight returns now the correct height for texts with newlines even WordWrap is not set."
Diffstat (limited to 'src')
-rw-r--r--src/guiFormSpecMenu.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index 2bf06c1d6..b0215a84a 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -2265,7 +2265,11 @@ void GUIFormSpecMenu::drawList(const ListDrawSpec &s, int phase,
this->bringToFront(m_tooltip_element);
m_tooltip_element->setText(tooltip_text.c_str());
s32 tooltip_width = m_tooltip_element->getTextWidth() + m_btn_height;
+#if IRRLICHT_VERSION_MAJOR >= 1 && IRRLICHT_VERSION_MINOR >= 8 && IRRLICHT_VERSION_REVISION >= 2
s32 tooltip_height = m_tooltip_element->getTextHeight() + 5;
+#else
+ s32 tooltip_height = m_tooltip_element->getTextHeight() * tt_rows.size() + 5;
+#endif
v2u32 screenSize = driver->getScreenSize();
int tooltip_offset_x = m_btn_height;
int tooltip_offset_y = m_btn_height;