Skip to content

Commit df1d2af

Browse files
committed
Editor: Don't call Canvas.End() when Canvas.Begin() failed (#186)
1 parent 3fdb8e3 commit df1d2af

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/CHANGELOG.txt

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ v0.9.2 (WIP):
4343

4444
BUGFIX: Canvas: Ensure canvas draw commands are separated from other ImGui draw commands (#205, #250)
4545

46+
BUGFIX: Editor: Don't call Canvas.End() when Canvas.Begin() failed (#186), thanks @pthom, @TheZoc
47+
4648

4749
v0.9.1 (2022-08-27):
4850

imgui_node_editor.cpp

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

11381138
if (!m_IsInitialized)
11391139
{
1140-
// Cycle canvas so it has a change to setup its size before settings are loaded
1141-
m_Canvas.Begin(id, canvasSize);
1142-
m_Canvas.End();
1140+
// Cycle canvas, so it has a chance to initialize its size before settings are loaded
1141+
if (m_Canvas.Begin(id, canvasSize))
1142+
m_Canvas.End();
11431143

11441144
LoadSettings();
11451145
m_IsInitialized = true;

0 commit comments

Comments
 (0)