mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 11:57:00 +00:00
TabBar: Added extra mis-usage error recovery. Past the assert, common mis-usage don't lead to hard crashes any more, facilitating integration with scripting languages. (#1651)
This commit is contained in:
parent
0f83145aa8
commit
9da48c16c5
@ -41,6 +41,8 @@ Other Changes:
|
||||
- InputText: Fixed an edge case crash that would happen if another widget sharing the same ID
|
||||
is being swapped with an InputText that has yet to be activated.
|
||||
- TabBar: Fixed a crash when using BeginTabBar() recursively (didn't affect docking). (#2371)
|
||||
- TabBar: Added extra mis-usage error recovery. Past the assert, common mis-usage don't lead to
|
||||
hard crashes any more, facilitating integration with scripting languages. (#1651)
|
||||
- Examples: OpenGL: Fix for OSX not supporting OpenGL 4.5, we don't try to read GL_CLIP_ORIGIN
|
||||
even if the OpenGL headers/loader happens to define the value. (#2366, #2186)
|
||||
|
||||
|
@ -5993,7 +5993,11 @@ void ImGui::EndTabBar()
|
||||
return;
|
||||
|
||||
ImGuiTabBar* tab_bar = g.CurrentTabBar;
|
||||
if (tab_bar == NULL)
|
||||
{
|
||||
IM_ASSERT(tab_bar != NULL && "Mismatched BeginTabBar()/EndTabBar()!");
|
||||
return; // FIXME-ERRORHANDLING
|
||||
}
|
||||
if (tab_bar->WantLayout)
|
||||
TabBarLayout(tab_bar);
|
||||
|
||||
@ -6376,7 +6380,11 @@ bool ImGui::BeginTabItem(const char* label, bool* p_open, ImGuiTabItemFlags f
|
||||
return false;
|
||||
|
||||
ImGuiTabBar* tab_bar = g.CurrentTabBar;
|
||||
if (tab_bar == NULL)
|
||||
{
|
||||
IM_ASSERT(tab_bar && "Needs to be called between BeginTabBar() and EndTabBar()!");
|
||||
return false; // FIXME-ERRORHANDLING
|
||||
}
|
||||
bool ret = TabItemEx(tab_bar, label, p_open, flags);
|
||||
if (ret && !(flags & ImGuiTabItemFlags_NoPushId))
|
||||
{
|
||||
@ -6393,7 +6401,11 @@ void ImGui::EndTabItem()
|
||||
return;
|
||||
|
||||
ImGuiTabBar* tab_bar = g.CurrentTabBar;
|
||||
if (tab_bar == NULL)
|
||||
{
|
||||
IM_ASSERT(tab_bar != NULL && "Needs to be called between BeginTabBar() and EndTabBar()!");
|
||||
return;
|
||||
}
|
||||
IM_ASSERT(tab_bar->LastTabItemIdx >= 0);
|
||||
ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx];
|
||||
if (!(tab->Flags & ImGuiTabItemFlags_NoPushId))
|
||||
|
Loading…
Reference in New Issue
Block a user