Skip to content

Commit 146732b

Browse files
committed
EditorContext::Begin: handle ImGuiEx::Canvas::Begin return at initial setup
if ImGuiEx::Canvas::Begin returns false (which can happen if the window is too small and the canvas is Clipped), then the subsequent call to ImGuiEx::Canvas::End() will trigger an IM_ASSERT
1 parent 2f99b2d commit 146732b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

imgui_node_editor.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1123,9 +1123,9 @@ void ed::EditorContext::Begin(const char* id, const ImVec2& size)
11231123

11241124
if (!m_IsInitialized)
11251125
{
1126-
// Cycle canvas so it has a change to setup its size before settings are loaded
1127-
m_Canvas.Begin(id, canvasSize);
1128-
m_Canvas.End();
1126+
// Cycle canvas, so it has a chance to set up its size before settings are loaded
1127+
if (m_Canvas.Begin(id, canvasSize))
1128+
m_Canvas.End();
11291129

11301130
LoadSettings();
11311131
m_IsInitialized = true;

0 commit comments

Comments
 (0)