diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index e2cae54f..fe0a5915 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -43,6 +43,8 @@ v0.9.2 (WIP): BUGFIX: Canvas: Ensure canvas draw commands are separated from other ImGui draw commands (#205, #250) + BUGFIX: Editor: Don't call Canvas.End() when Canvas.Begin() failed (#186), thanks @pthom, @TheZoc + v0.9.1 (2022-08-27): diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp index 0295892b..41ba6f02 100644 --- a/imgui_node_editor.cpp +++ b/imgui_node_editor.cpp @@ -1137,9 +1137,9 @@ void ed::EditorContext::Begin(const char* id, const ImVec2& size) if (!m_IsInitialized) { - // Cycle canvas so it has a change to setup its size before settings are loaded - m_Canvas.Begin(id, canvasSize); - m_Canvas.End(); + // Cycle canvas, so it has a chance to initialize its size before settings are loaded + if (m_Canvas.Begin(id, canvasSize)) + m_Canvas.End(); LoadSettings(); m_IsInitialized = true;