Skip to content

Commit

Permalink
Editor: Don't call Reasume/Suspend on invisible canvas (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
thedmd committed Sep 19, 2023
1 parent 51537d8 commit eb1b2f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ v0.10.0 (WIP):

BUGFIX: Canvas: Ensure SentinelDrawCallback cleanup (#255)

BUGFIX: Editor: Don't call Reasume/Suspend on invisible canvas (#255)


v0.9.2 (2023-09-01):

Expand Down
6 changes: 4 additions & 2 deletions imgui_node_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1965,7 +1965,8 @@ void ed::EditorContext::Suspend(SuspendFlags flags)
IM_ASSERT(m_DrawList != nullptr && "Suspend was called outiside of Begin/End.");
auto lastChannel = m_DrawList->_Splitter._Current;
m_DrawList->ChannelsSetCurrent(m_ExternalChannel);
m_Canvas.Suspend();
if (m_IsCanvasVisible)
m_Canvas.Suspend();
m_DrawList->ChannelsSetCurrent(lastChannel);
if ((flags & SuspendFlags::KeepSplitter) != SuspendFlags::KeepSplitter)
ImDrawList_SwapSplitter(m_DrawList, m_Splitter);
Expand All @@ -1978,7 +1979,8 @@ void ed::EditorContext::Resume(SuspendFlags flags)
ImDrawList_SwapSplitter(m_DrawList, m_Splitter);
auto lastChannel = m_DrawList->_Splitter._Current;
m_DrawList->ChannelsSetCurrent(m_ExternalChannel);
m_Canvas.Resume();
if (m_IsCanvasVisible)
m_Canvas.Resume();
m_DrawList->ChannelsSetCurrent(lastChannel);
}

Expand Down

0 comments on commit eb1b2f8

Please sign in to comment.