Skip to content

Commit

Permalink
Editor: Don't call Canvas.End() when Canvas.Begin() failed (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
thedmd committed Sep 1, 2023
1 parent 3fdb8e3 commit df1d2af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down
6 changes: 3 additions & 3 deletions imgui_node_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit df1d2af

Please sign in to comment.