Skip to content

Commit 88acda0

Browse files
committedMay 20, 2016
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."
1 parent 8ba6d9f commit 88acda0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

Diff for: ‎src/guiFormSpecMenu.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -2265,7 +2265,11 @@ void GUIFormSpecMenu::drawList(const ListDrawSpec &s, int phase,
22652265
this->bringToFront(m_tooltip_element);
22662266
m_tooltip_element->setText(tooltip_text.c_str());
22672267
s32 tooltip_width = m_tooltip_element->getTextWidth() + m_btn_height;
2268+
#if IRRLICHT_VERSION_MAJOR >= 1 && IRRLICHT_VERSION_MINOR >= 8 && IRRLICHT_VERSION_REVISION >= 2
Has conversations. Original line has conversations.
22682269
s32 tooltip_height = m_tooltip_element->getTextHeight() + 5;
2270+
#else
2271+
s32 tooltip_height = m_tooltip_element->getTextHeight() * tt_rows.size() + 5;
2272+
#endif
22692273
v2u32 screenSize = driver->getScreenSize();
22702274
int tooltip_offset_x = m_btn_height;
22712275
int tooltip_offset_y = m_btn_height;

0 commit comments

Comments
 (0)
Please sign in to comment.