Skip to content

Commit

Permalink
Node editor fix node title context menus
Browse files Browse the repository at this point in the history
  • Loading branch information
Auburn committed Dec 26, 2024
1 parent d25e043 commit 16dd2ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/NodeEditor/FastNoiseNodeEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,18 +1048,19 @@ void FastNoiseNodeEditor::DoNodes()
}

ImNodes::EndNodeTitleBar();
ImGuiID popupId = ImGui::GetItemID();

if( ImGui::IsMouseReleased( ImGuiMouseButton_Right ) && ImGui::IsItemHovered( ImGuiHoveredFlags_AllowWhenBlockedByPopup ) )
{
ImGui::SetCurrentContext( mMainContext );
ImGui::OpenPopup( "node_title" );
ImGui::OpenPopup( popupId );
}

ImGui::SetCurrentContext( mMainContext );
// Right click node title to change node type
ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding, ImVec2( 4, 4 ) );

if( ImGui::BeginPopup( "node_title" ) )
if( ImGui::BeginPopupEx( popupId, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings ) )
{
if( ImGui::MenuItem( "Copy Encoded Node Tree" ) )
{
Expand Down

0 comments on commit 16dd2ef

Please sign in to comment.