- Home /
GUIContent with an image and text getting not drawing image
Hey y'all, I've got a function that will draw a foldout using the EditorGUILayout.Foldout function that takes a GUIContent object with text and an image. I'm drawing a series of these in an editor window and they all use the same texture for their image. When it runs most of the items draw the image but some don't. I noticed the ones that don't are the ones with longer text. It just doesn't draw the image (which is normally on the left). It does this even though there's plenty of horizontal space to hold both the image and the text. I'm drawing with the "foldout" style which doesn't have a fixed width and should be able to expand. In fact it expands the text just fine.
Does anyone know why it would arbitrarily decide to not draw the image in some cases?
I tried getting a rect for it with GUILayoutUtility.GetRect and then drawing into that rect and I got the same result. I even tried just expanding the width of the rect and not even that did it.
Your answer
Follow this Question
Related Questions
UI Vertical Layout Group with Content Size Fitter, how to set max width? 1 Answer
Change size of an UI object ( Javascript ( Unityscript) ) 0 Answers
Sprite Image size for different mobile resolutions 0 Answers
Retreive the Width Delta of a ContentSizeFitter game object 0 Answers
How do you set minimum EditorWindow size when undocked? 0 Answers