HACK: do not draw tabs without name

master
Maksim 2022-02-20 18:56:15 +01:00
parent ee05de9d69
commit a8cb399bcf
1 changed files with 9 additions and 1 deletions

View File

@ -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;