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


    Sep 14, 2013
    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:


    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.

    Attached Files: