Skip to content

Commit

Permalink
Don't manipulate channels when editor is suspended thedmd#28
Browse files Browse the repository at this point in the history
Introduction of ImDrawListSplitter changed how channels should
be managed internally. Now we do not need to worry about user
code colliding with ours.
  • Loading branch information
thedmd authored and fdfxalex committed Dec 31, 2019
1 parent 25c0f23 commit ff7577c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions NodeEditor/Source/imgui_node_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1961,8 +1961,11 @@ void ed::EditorContext::SetUserContext(bool globalSpace)
//ImGui::SetCursorScreenPos(ImFloor(mousePos));
//ImGui::SetCursorScreenPos(ImVec2(floorf(mousePos.x), floorf(mousePos.y)));

auto drawList = ImGui::GetWindowDrawList();
drawList->ChannelsSetCurrent(c_UserChannel_Content);
if (!IsSuspended())
{
auto drawList = ImGui::GetWindowDrawList();
drawList->ChannelsSetCurrent(c_UserChannel_Content);
}

// #debug
// drawList->AddCircleFilled(ImGui::GetMousePos(), 4, IM_COL32(0, 255, 0, 255));
Expand Down

0 comments on commit ff7577c

Please sign in to comment.