hugoattal / ElectronicNodes

Wiring style for blueprint and material editors in the Unreal Engine
99 stars 10 forks source link

1px wire offset where pin offset ends at high resolution #55

Closed Dr-Turtle closed 2 years ago

Dr-Turtle commented 2 years ago

Describe the bug With Pin Horizontal Offset > 0, wires that should be straight (by using the straighten connections bind) will be adjusted by 1 pixel where the offset ends.

To Reproduce Steps to reproduce the behavior:

  1. Use a 2560x1440p monitor
  2. Connect any two nodes
  3. Press the align key ('Q' by default)

I couldn't find a way to consistently reproduce this, but it should be apparent in any project with a lot of straightened connections, behavior seems to be different depending on which node was selected first.

Expected behavior Wires to be perfectly straight when straightened (like the behavior without electronic nodes).

Screenshots If applicable, add screenshots to help explain your problem. image

Environment (please complete the following information):

Additional context This occurs at 2560x1440p but not 1920x1080p. Disabling "High DPI Support" in Editor Preferences>General>Apperance fixes this (but is not a practical solution due to everything being blurred).

hugoattal commented 2 years ago

The pins aren't actually aligned by the engine, so this is the expected behavior. If you disabled Electronic Nodes you'll see a very slight spline.

The problem lies in the pin placements (and I can't change them...). I'm okay to deploy a solution, but what would it lool like?

Dr-Turtle commented 2 years ago

The problem lies in the pin placements

I'm not entirely sure what you mean by this, but here are a few potential fixes I came up with:

I did some additional testing and noticed that the issue only occurs with straight connections, but not when the wire alignment is set to "Left" and the connection is not straight image image I would expect it to not make a difference, because in both cases, the wire meets the horizontal offset at 180 degrees, but only the first one, where the entire wire should be straight, has the issue

Furthermore, the degree of misalignment seems to vary (although I do not know why), the following screenshot appears to be misaligned more than the first image

hugoattal commented 2 years ago

I'm not entirely sure what you mean by this

The pins are these elements : image

They are not aligned. In this image, the right one is one pixel upper than the left one (it's actually half a pixel, but you get the idea) image

These pins are placed by the Unreal Engine, and Electronic Nodes can't change their positions. I previously tried to smooth it if the wire was very close to be flat, but ended up with this kind of problems: https://forums.unrealengine.com/t/electronic-nodes-wiring-style-for-blueprint-and-material-editors/129275/63?u=herobrine20xx

Long story short: the misalignment is not cause by Electronic Nodes, but by the engine. If you disable Electronic Nodes, you would still get these misalignments.

hugoattal commented 2 years ago

I'm closing this as it's not an Electronic Nodes bug, and there's no way for me to "fix" this 😕...