diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp index 3e153928..4f00adf9 100644 --- a/imgui_node_editor.cpp +++ b/imgui_node_editor.cpp @@ -1123,9 +1123,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 set up its size before settings are loaded + if (m_Canvas.Begin(id, canvasSize)) + m_Canvas.End(); LoadSettings(); m_IsInitialized = true;