Fix tooltip height for versions of irrlicht < 1.8.2
authorCraig Robbins <kde.psych@gmail.com>
Fri, 20 May 2016 11:18:59 +0000 (21:18 +1000)
committerCraig Robbins <kde.psych@gmail.com>
Fri, 20 May 2016 14:26:04 +0000 (00:26 +1000)
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."

src/guiFormSpecMenu.cpp

index 2bf06c1d653bf90df578e5c67569a0f2147074cb..b0215a84aee11e79de3094649140c8068583a99c 100644 (file)
@@ -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;