Search Unity

EditorWindow Spacing inconsistent on 4k monitors possibly

Discussion in 'Editor & General Support' started by KaiClavier, May 27, 2019.

  1. KaiClavier

    KaiClavier

    Joined:
    Jan 23, 2015
    Posts:
    70
    Got an odd thing here and I'm not 100% sure what I'm doing wrong... I got 0 results on google so maybe someone here will know.

    I recently put out a text/dialogue management tool called Fleece, and I'm having a bit of trouble with custom editor windows and 4k / high-dpi screens... a friend of mine was testing it out for me and the difference in screen resolution seems to be the cause of the problem, but it could potentially be something else?

    Here's what the editor is supposed to look like, the problem is with the inspector-like panel on the left.



    On the 4k monitors, that scroll bar extends waaaaay past the limits of the editor window, pushing the links, colour choices, & delete button off-screen. Even when restricting the height of the scroll bar with GUILayout.Height() (even when setting this to an unchanging float!!) the height ends up weirdly inconsistent on the 4k monitors, exponentially changing in size as the editor window changes its height. The delete button is meant to always be aligned to the bottom of the window.

    Does anyone have any idea what's causing this?
     
  2. KaiClavier

    KaiClavier

    Joined:
    Jan 23, 2015
    Posts:
    70
    Just for reference, this is how it's appearing on 4K monitors:

     
  3. KaiClavier

    KaiClavier

    Joined:
    Jan 23, 2015
    Posts:
    70
    It's been two weeks, so I'm bumping this... Why would the editor return Screen.height as different values on different DPI monitors? For instance... if I set the scroll bar's height to be Screen.height - 24f, on a regular monitor it scales as expected with the window. But on a 4K monitor, the distance between the end of the scrollbar and the bottom of the window grows and shrinks as the window resizes.
     
  4. KaiClavier

    KaiClavier

    Joined:
    Jan 23, 2015
    Posts:
    70
    Discovered that this may be tied to Windows' "Scale everything 125%" setting. Is there any way to factor that in with regards to positioning...? Or is this still a bug?