Skip to content

Commit eb1b2f8

Browse files
committed
Editor: Don't call Reasume/Suspend on invisible canvas (#255)
1 parent 51537d8 commit eb1b2f8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/CHANGELOG.txt

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ v0.10.0 (WIP):
88

99
BUGFIX: Canvas: Ensure SentinelDrawCallback cleanup (#255)
1010

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

1214
v0.9.2 (2023-09-01):
1315

imgui_node_editor.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,8 @@ void ed::EditorContext::Suspend(SuspendFlags flags)
19651965
IM_ASSERT(m_DrawList != nullptr && "Suspend was called outiside of Begin/End.");
19661966
auto lastChannel = m_DrawList->_Splitter._Current;
19671967
m_DrawList->ChannelsSetCurrent(m_ExternalChannel);
1968-
m_Canvas.Suspend();
1968+
if (m_IsCanvasVisible)
1969+
m_Canvas.Suspend();
19691970
m_DrawList->ChannelsSetCurrent(lastChannel);
19701971
if ((flags & SuspendFlags::KeepSplitter) != SuspendFlags::KeepSplitter)
19711972
ImDrawList_SwapSplitter(m_DrawList, m_Splitter);
@@ -1978,7 +1979,8 @@ void ed::EditorContext::Resume(SuspendFlags flags)
19781979
ImDrawList_SwapSplitter(m_DrawList, m_Splitter);
19791980
auto lastChannel = m_DrawList->_Splitter._Current;
19801981
m_DrawList->ChannelsSetCurrent(m_ExternalChannel);
1981-
m_Canvas.Resume();
1982+
if (m_IsCanvasVisible)
1983+
m_Canvas.Resume();
19821984
m_DrawList->ChannelsSetCurrent(lastChannel);
19831985
}
19841986

0 commit comments

Comments
 (0)