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

Fit view to bounds #1474

Merged
merged 3 commits into from
Nov 8, 2024
Merged

Fit view to bounds #1474

merged 3 commits into from
Nov 8, 2024

Conversation

bezo97
Copy link
Collaborator

@bezo97 bezo97 commented Nov 8, 2024

This PR adds a new functionality to fit the canvas view to the currently selected group of nodes, or to the whole graph when nothing is selected.

  • Replaces the reset view button on graph canvas menu
    image

  • since f shortcut is already taken, I bound it to . by default which may be familiar from Blender's node editor with the same function.

This PR fixes #1402

fit_view_demo.mp4

Waiting on this PR in litegraph repo to be merged: Comfy-Org/litegraph.js#282

@bezo97
Copy link
Collaborator Author

bezo97 commented Nov 8, 2024

@huchenlei
Copy link
Member

I think we can probably replace the "Reset View" with "Fit View", as it seems to be superior. We can do that modification in another PR.

bezo97 and others added 2 commits November 8, 2024 14:14
- fit view to canvas selection
- fit view to whole graph when nothing is selected
- add button to graph canvas menu
- assign default keybinding '.'
@huchenlei huchenlei marked this pull request as ready for review November 8, 2024 19:24
Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@comfyorg/litegraph@0.8.24 None 0 2.42 MB k1oride

🚮 Removed packages: npm/@comfyorg/litegraph@0.8.23

View full report↗︎

@huchenlei huchenlei merged commit 0161a67 into main Nov 8, 2024
9 checks passed
@huchenlei huchenlei deleted the feature/fit-view branch November 8, 2024 20:03
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.

[Feature Request]: Focus selected node(s) or whole workflow graph using 'F' shortcut key
2 participants