diff options
Diffstat (limited to 'scene/gui/tab_container.cpp')
-rw-r--r-- | scene/gui/tab_container.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 1e31f9e206..133966013b 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -72,6 +72,8 @@ int TabContainer::_get_top_margin() const { } void TabContainer::_gui_input(const Ref<InputEvent> &p_event) { + ERR_FAIL_COND(p_event.is_null()); + Ref<InputEventMouseButton> mb = p_event; Popup *popup = get_popup(); @@ -392,6 +394,7 @@ void TabContainer::_notification(int p_what) { Vector<int> tab_widths; for (int i = first_tab_cache; i < tabs.size(); i++) { if (get_tab_hidden(i)) { + tab_widths.push_back(0); continue; } int tab_width = _get_tab_width(i); @@ -583,7 +586,7 @@ void TabContainer::_refresh_texts() { Control *control = Object::cast_to<Control>(tabs[i]); String text = control->has_meta("_tab_name") ? String(tr(String(control->get_meta("_tab_name")))) : String(tr(control->get_name())); Ref<TextLine> name; - name.instance(); + name.instantiate(); name->set_direction(rtl ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR); name->add_string(text, font, font_size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); text_buf.push_back(name); |