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

Node material editor is not rendering the connections properly #14100

Closed
AlexDaniel opened this issue Jul 31, 2023 · 5 comments
Closed

Node material editor is not rendering the connections properly #14100

AlexDaniel opened this issue Jul 31, 2023 · 5 comments
Assignees
Milestone

Comments

@AlexDaniel
Copy link

AlexDaniel commented Jul 31, 2023

Peek 2023-07-31 13-08

If you look closely, the connections are rendered correctly within the frame container, but somehow it is not resized correctly:

image

  • BabylonJS 6.14.0
  • Browser Firefox, Chromium

Additional context
It used to work previously, I don't know why it just stopped. Could be because I updated BabylonJS, or maybe it has to do with something else.

Quick hack:
By setting:

width: 6000px;
height: 6000px;

On the <svg> element, I'm able to see all connections of my material.

@carolhmj
Copy link
Contributor

Hello! We usually ask first to validate the issue on our forum first: https://forum.babylonjs.com/c/bugs/8
I haven't been able to reproduce this with a newly created Node Material, are you using any specific material? Are you running from nme.babylon.com, or on a local project?

@AlexDaniel
Copy link
Author

AlexDaniel commented Jul 31, 2023

Not reproducible on nme.babylon.com. Running locally with Vite. Happens with any material.

@bghgary bghgary added this to the 7.0 milestone Jul 31, 2023
@carolhmj
Copy link
Contributor

carolhmj commented Aug 1, 2023

Can you share a repro of your project?

@AlexDaniel
Copy link
Author

@carolhmj OK, I think I figured it out. So here's what's happening in my case.

I'm using Quasar. It turns out that it comes with some default CSS that works around some browser quirks. Specifically, there is an explicit overflow property set for svgs:

https://github.com/quasarframework/quasar/blob/b82b12846dd67e425d4c159e6b51100d703550ed/ui/src/css/normalize.sass#L57

/*
 * Hide the overflow in IE.
 */

svg:not(:root)
  overflow: hidden

It seems that the NME is expecting the opposite. So, to fix the rendering, I can simply add this to my CSS:

svg:not(:root) {
  overflow: visible !important;
}

Now, while it's easy to say that it's an issue in Quasar and not in BabylonJS, I'm not 100% confident about that, because pretty much everything else is working correctly except for node connections. Maybe it makes sense to change the NME layout a bit, so that the SVG is actually taking the size of the viewport?

@AlexDaniel
Copy link
Author

Actually, I take it back 😇 See this: necolas/normalize.css#718

I think Quasar needs to update its normalize styles a bit. I'll create a ticket for that.

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

3 participants