Merge pull request #43173 from volzhs/fix-tab-container
Fix crash in TabContainer in case of no content at all
This commit is contained in:
commit
debb67918e
@ -371,8 +371,10 @@ void TabContainer::_notification(int p_what) {
|
|||||||
// Draw the tab area.
|
// Draw the tab area.
|
||||||
panel->draw(canvas, Rect2(0, header_height, size.width, size.height - header_height));
|
panel->draw(canvas, Rect2(0, header_height, size.width, size.height - header_height));
|
||||||
|
|
||||||
// Draw selected tab in front
|
// Draw selected tab in front. Need to check tabs.size() in case of no contents at all.
|
||||||
_draw_tab(tab_fg, font_color_fg, current, tabs_ofs_cache + x_current);
|
if (tabs.size() > 0) {
|
||||||
|
_draw_tab(tab_fg, font_color_fg, current, tabs_ofs_cache + x_current);
|
||||||
|
}
|
||||||
|
|
||||||
// Draw the popup menu.
|
// Draw the popup menu.
|
||||||
x = get_size().width;
|
x = get_size().width;
|
||||||
|
Loading…
Reference in New Issue
Block a user