Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

LittleCoinCoin
Copy link

Major:

  • Using NavigateAction::m_IsActive boolean (m_NavigateAction of the EditorContext)
  • Added methods To gloabal API to directly set it to true (ResumeNavigation) or false (SuspendNavigation).
  • As a result, we can call the couple Suspend/Resume to momentarily deactivate the canvas zoom.

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

## Major:
- Original NavigateAction (m_NavigateAction of the EditorContext) already has a m_IsActive boolean
- Added methods To gloabal API to directly set it to true (ResumeNavigation) or false (SuspendNavigation).
- As a result, we can call the couple Suspend/Resume to momentarily deactivate the canvas zoom.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant