From a8cb399bcf0021fca44d59170eeb67cf3e0270aa Mon Sep 17 00:00:00 2001 From: Maksim Date: Sun, 20 Feb 2022 18:56:15 +0100 Subject: [PATCH] HACK: do not draw tabs without name --- source/Irrlicht/CGUITabControl.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/Irrlicht/CGUITabControl.cpp b/source/Irrlicht/CGUITabControl.cpp index 998856b1..831bb744 100644 --- a/source/Irrlicht/CGUITabControl.cpp +++ b/source/Irrlicht/CGUITabControl.cpp @@ -498,7 +498,12 @@ s32 CGUITabControl::calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, b if ( !font ) return 0; - s32 len = font->getDimension(text).Width + TabExtraWidth; + s32 len = font->getDimension(text).Width; + if ( len > 0 ) + len += TabExtraWidth; + else + return 0; + if ( TabMaxWidth > 0 && len > TabMaxWidth ) len = TabMaxWidth; @@ -661,6 +666,9 @@ void CGUITabControl::draw() // get text length s32 len = calcTabWidth(pos, font, text, true); + if ( len == 0 ) + continue; + if ( ScrollControl && pos+len > UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 ) { needRightScroll = true;