Blazor-Diagrams / Blazor.Diagrams

A fully customizable and extensible all-purpose diagrams library for Blazor
https://blazor-diagrams.zhaytam.com
MIT License
993 stars 196 forks source link

Leftover elements on dragging nodes #143

Closed karan-kang closed 2 years ago

karan-kang commented 2 years ago

Version Information

.NET Framework:         5.0
Blazor Hosting:         Server     
Z.Blazor.Diagram:       2.1.5   
Browser:                Edge 94.0.992.38               

image

zHaytam commented 2 years ago

Hello, I will need more information if possible.

If you can provide a reproducible little example project, that would help me a lot!

314159265meow commented 2 years ago

Hi, I noticed this problem as well. It's not easy to reproduce reliably and seems to occur only at a very low zoom level. To me it looks like a browser render problem, maybe related to non-integer coordinates. So far I have no good idea how to fix it.

I managed to reproduce it at your demo page https://blazor-diagrams.zhaytam.com/demos/custom-group Animation2

Maybe this helps somehow.

zHaytam commented 2 years ago

I can also "sometimes" reproduce it in a very low zoom level and only when using CSS borders. When I remove the borders or replace it by something like box-shadow, then it doesn't happen.

Unfortunately I don't know exactly what the issue is, but the library doesn't do anything to cause it as far as I know...

zHaytam commented 2 years ago

@314159265meow Could you please try adding the following CSS and telling me if it still happens? Because for me, and for some reason I don't know, this fixes it:

.diagram-canvas {
    backface-visibility: hidden;
}
314159265meow commented 2 years ago

This fixes it for me as well. "In the old days" this was a trick to force the activation of hardware acceleration, not sure exactly how this works today.

I found another way to work around the issue. In the example of the custom group, it works if I set a border and a transparent outline, like this:

.group.custom {
  border: 2px solid black;
  outline: 6px solid transparent;
}

Also this problem doesn't seem to be related to this library, I managed to reproduce it in a single HTML file with 3 divs and a few lines of JavaScript.

zHaytam commented 2 years ago

Could you please send me the code you reproduced it with?

314159265meow commented 2 years ago

Sure, on the page you can use the mouse wheel to zoom and this produces the same artifacts for me. index.zip

zHaytam commented 2 years ago

Closing this since it's not related to the library, thanks!