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

[Feature] Fit selected nodes into view #88

Open
jpk6789 opened this issue Feb 24, 2024 · 1 comment
Open

[Feature] Fit selected nodes into view #88

jpk6789 opened this issue Feb 24, 2024 · 1 comment
Assignees
Labels
enhancement New feature or enhancement

Comments

@jpk6789
Copy link

jpk6789 commented Feb 24, 2024

Hi,

currently, there is a function to try to fit all elements in the nodify editor into view. This function can also fit an area into view. There is also a function to jump to a specific location. However, there is currently no function to fit the selected nodes into view. This would be a great to find the selected nodes.

I started to implement this feature with a new RoutedUICommand for a PR but was a little bit uncertain, how to get the actual area, the selected ItemContainers use. The calculation should in some parts be similar to the ArrangeOverride function in the NodifyCanvas class. However, can I use the Location and DesiredSize properties of the ItemContainers for that calculation or is there a better way to implement such a feature?

@jpk6789 jpk6789 added the enhancement New feature or enhancement label Feb 24, 2024
@miroiu
Copy link
Owner

miroiu commented Feb 25, 2024

Hi,

You can get the selected containers by using the NodifyEditor.SelectedContainers property. And you're right! The calculation is similar to how NodifyCanvas calculates the Extent (by using Location and RenderSize).

Let me know if you need more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants