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

Visibility of nodes when using Virtualization #491

Open
nicolassargos opened this issue Dec 13, 2024 · 0 comments
Open

Visibility of nodes when using Virtualization #491

nicolassargos opened this issue Dec 13, 2024 · 0 comments

Comments

@nicolassargos
Copy link

Hi,

First, congratulations for your work, it's an amazing library!

I noticed an undesirable behaviour though when you use virtualization and change the visibility of nodes:

  • I have enabled virtualization on nodes in the options.
  • I have some nodes in my container and a switch for their visibility. When I hit the switch, the nodes disappear.
  • When I pan, the nodes immediately reappear and I checked, their Visible property is set to true.

After checking your code, I think it comes from this line (https://github.com/Blazor-Diagrams/Blazor.Diagrams/blob/47e4c68d175f0c600c279383c2c77dce82205665/src/Blazor.Diagrams.Core/Behaviors/VirtualizationBehavior.cs#L60:
model.Visible = right > 0 && left < Diagram.Container!.Width && bottom > 0 && top < Diagram.Container.Height;

I guess you could have another property, like 'UserVisible' & 'VirtualizationVisible' and Visible could be => UserVisible && VirtualizationVisible.

In the meantime, I disabled virtualization as I'm still developping my own library on top of yours.

Thanks again for your work,
Nicolas.

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

No branches or pull requests

1 participant