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

3D scene Event Visualizer is offset #17

Open
satolas opened this issue Apr 27, 2020 · 9 comments
Open

3D scene Event Visualizer is offset #17

satolas opened this issue Apr 27, 2020 · 9 comments

Comments

@satolas
Copy link

satolas commented Apr 27, 2020

In the 3D view (Scene view)
The lines representing the events are offset or nonexistent, they fly somewhere.
Expected behavior : connect the objects with events together.
It seems to be bug in the way they are draw in front of the camera.

Maybe in EventGraphWindow.cs in the WorldToGUIPoint Method ?

INFOS :
Blank Unity 2019.3.1f project with UnityEventVisualizer 1.3 and 1.4

EventVisualizerBug

@MephestoKhaan
Copy link
Owner

MephestoKhaan commented Apr 27, 2020 via email

@satolas
Copy link
Author

satolas commented Apr 27, 2020

Unity 2019.3.1f :-)

@satolas
Copy link
Author

satolas commented Apr 28, 2020

Some news ?
By the way I wrote a comment there as well :
https://forum.unity.com/threads/github-unityevent-visualizer.498768/

Can't wait to tryout this amazing feature :-)
Cheers, Stay safe.

@MephestoKhaan
Copy link
Owner

MephestoKhaan commented Apr 28, 2020 via email

@MephestoKhaan
Copy link
Owner

MephestoKhaan commented Apr 30, 2020

I upgraded the demo to 2019.3.3f1 and cannot reproduce your issue:
image

Are you seeing this problem in the provided demo scene?
Have you tried downloading the repo directly? (It should be pretty much version 1.4 anyway)

@MephestoKhaan
Copy link
Owner

Ah nevermind! I think I know what your problem is, do you have your Screen set to 150% or something like that for example?

@satolas
Copy link
Author

satolas commented Apr 30, 2020 via email

@MephestoKhaan
Copy link
Owner

MephestoKhaan commented Apr 30, 2020

cannot find so far a "general" solution. Since it seems that Unity really has problems with scaling and different DPIs.

While I fix this try this:

In EventGraphWindows.cs at the VERY END

replace the return of the method WorldToGUIPoint with;

			float scaleFactor = Screen.dpi / 160f;
			return new Vector2(
				viewPos.x *  cam.scaledPixelWidth,
				(1 - viewPos.y) * cam.scaledPixelHeight) * scaleFactor;

Where 160 should be the default dpi of your screen (maybe it is 160 maybe it is 96). Or maybe you can set the scaleFactor entirely to 0.75 for example (if you are running Windows at 1.25x scale)

In the mean time I will keep reading on how to get the proper value from Windows.

@MephestoKhaan
Copy link
Owner

MephestoKhaan commented Apr 30, 2020

Some related issues I have found:
https://forum.unity.com/threads/editor-dpi-scaling-issues.689980/
https://forum.unity.com/threads/editor-ui-needs-to-improve-and-support-high-dpi.527501/

Seems like they don;t properly support scaling windows unless it is rounded scales like 200% or 400%

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

2 participants