Made it illegal to call Begin("") with an empty string. This somehow accidentally worked before but had various undesirable side-effect as the window would have ID zero. In particular it is causing problems in viewport/docking branches.

This commit is contained in:
omar 2018-12-20 20:01:02 +01:00
parent 39dde66b21
commit b471813f54
2 changed files with 3 additions and 1 deletions

View File

@ -37,6 +37,8 @@ Breaking Changes:
- Renamed io.ConfigResizeWindowsFromEdges to io.ConfigWindowsResizeFromEdges and removed its [Beta] mark. - Renamed io.ConfigResizeWindowsFromEdges to io.ConfigWindowsResizeFromEdges and removed its [Beta] mark.
The addition of new configuration options in the Docking branch is pushing for a little reorganization of those names. The addition of new configuration options in the Docking branch is pushing for a little reorganization of those names.
- Made it illegal to call Begin("") with an empty string. This somehow accidentally worked before but had various
undesirable side-effect as the window would have ID zero. In particular it is causing problems in viewport/docking branches.
Other Changes: Other Changes:
- Added BETA api for Tab Bar/Tabs widgets: (#261, #351) - Added BETA api for Tab Bar/Tabs widgets: (#261, #351)

View File

@ -4621,7 +4621,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
{ {
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style; const ImGuiStyle& style = g.Style;
IM_ASSERT(name != NULL); // Window name required IM_ASSERT(name != NULL && name[0] != '\0'); // Window name required
IM_ASSERT(g.FrameScopeActive); // Forgot to call ImGui::NewFrame() IM_ASSERT(g.FrameScopeActive); // Forgot to call ImGui::NewFrame()
IM_ASSERT(g.FrameCountEnded != g.FrameCount); // Called ImGui::Render() or ImGui::EndFrame() and haven't called ImGui::NewFrame() again yet IM_ASSERT(g.FrameCountEnded != g.FrameCount); // Called ImGui::Render() or ImGui::EndFrame() and haven't called ImGui::NewFrame() again yet