Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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."
  • Loading branch information
Zeno- committed May 20, 2016
1 parent 8ba6d9f commit 88acda0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/guiFormSpecMenu.cpp
Expand Up @@ -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

This comment has been minimized.

Copy link
@est31

est31 May 23, 2016

Contributor

On irrlicht 1.9.0 this will take the else branch, not the if branch no?

This comment has been minimized.

Copy link
@nerzhul

nerzhul May 23, 2016

Member

between irrlicht 1.9.0 & 1.9.1 yes

This comment has been minimized.

Copy link
@est31

est31 May 23, 2016

Contributor

This should be fixed

This comment has been minimized.

Copy link
@Zeno-

Zeno- May 23, 2016

Author Contributor

:3

This comment has been minimized.

Copy link
@Zeno-

Zeno- May 23, 2016

Author Contributor

commit 22f78ea

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;
Expand Down

0 comments on commit 88acda0

Please sign in to comment.