thedmd / imgui-node-editor

Node Editor built using Dear ImGui
MIT License
3.73k stars 551 forks source link

[Add] Suspend/Resume Canvas Zoom by desactivating Navigation #220

Open LittleCoinCoin opened 1 year ago

LittleCoinCoin commented 1 year ago

Major:

Use Case Example

When hovering over a ListBox (this is a custom to my project), I can call ax::NodeEditor::SuspendNavigation() before a portion of code that wants to use the ImGui::GetIO().MouseWheel input. Then, I call ax::NodeEditor::ResumeNavigation().

Pseudo-code

if (isListBoxHovered())
{
    ax::NodeEditor::SuspendNavigation();

    //handle list box scrolling

    ax::NodeEditor::ResumeNavigation();
}

NodeEditorZoomSuspendResume