- Home /
EditorGUI.Popup drawing in the wrong position (ONLY ON MAC)
Hope somebody can help with this weird problem,
I am drawing a popup menu in the editor from a custom property drawer, on PC the popup draws exactly as expected, however on a mac the popup is drawn right at the top of the window as shown in the image.
the code:
[CustomPropertyDrawer(typeof(SoundSelector))]
public class SoundSelectorDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
SoundSelector soundSelectorAttribute = attribute as SoundSelector;
Rect labelPos = new Rect (position.x, position.y, position.width * 0.4f, position.height);
Rect popupPos = new Rect (position.x + position.width * 0.4f, position.y, position.width * 0.6f, position.height);
var index = soundSelectorAttribute.names.FindIndex(s => s == property.stringValue);
EditorGUI.LabelField(labelPos, property.displayName);
index = EditorGUI.Popup(popupPos, index, soundSelectorAttribute.keys.ToArray());
if (index >= 0) {
property.stringValue = soundSelectorAttribute.names[index];
}
else {
//default value
property.stringValue = soundSelectorAttribute.names[0];
}
}
}
does anyone know what the cause of this could be?
Much appreciated!
Answer by Adam-Mechtley · Oct 20, 2016 at 04:56 PM
Hi @jacquesjordaan! Could you please submit a bug report on this?
Your answer
![](https://koobas.hobune.stream/wayback/20220612095043im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
DropDownList with string array in Property Drawer 0 Answers
Custom attribute not respecting property's PropertyDrawer 0 Answers
Making a custom popup for data objects: Can I use the PropertyDrawer to change the object itself? 0 Answers
Field in PropertyDrawer isn't remembered 1 Answer
GUI Popup problem…! 1 Answer