Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Why did Unity add kPrefixPaddingRight

Discussion in 'Immediate Mode GUI (IMGUI)' started by CDF, Aug 19, 2020.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,295
    So frustrating. An internal constant not accessible was added:
    internal const float kPrefixPaddingRight = 2;

    which PrefixLabel uses to return the control rect.

    I know it's a small thing, but a lot of my custom editor scripts (and even Unity editor scripts) have fields offset by 2px compared to other fields.

    For example, the LocalizedString drawer from Unity Localization package:

    prefixPadding.png

    Probably just using EditorGUIUtility.labelWidth to offset the control rect, because that's the way it's always been!

    At least expose kPrefixPaddingRight or modify the EditorGUIUtility.labelWidth property.
    :rolleyes:
     

    Attached Files: