Fix height of popup (was covering click area of expanded type's properties)

This commit is contained in:
Adam Ramberg 2022-10-22 23:50:06 +02:00
parent db92528786
commit d16355936e

View File

@ -56,6 +56,7 @@ namespace UnityAtoms.Editor
// Calculate rect for configuration button
Rect buttonRect = new Rect(position);
buttonRect.yMin += _popupStyle.margin.top;
buttonRect.yMax = buttonRect.yMin + EditorGUIUtility.singleLineHeight;
buttonRect.width = _popupStyle.fixedWidth + _popupStyle.margin.right;
position.xMin = buttonRect.xMax;
@ -75,7 +76,7 @@ namespace UnityAtoms.Editor
var valueFieldHeight = EditorGUI.GetPropertyHeight(usageTypeProperty, label);
usageTypeProperty.isExpanded = expanded;
if (usageTypePropertyName == "_value" && valueFieldHeight > EditorGUIUtility.singleLineHeight+2)
if (usageTypePropertyName == "_value" && valueFieldHeight > EditorGUIUtility.singleLineHeight + 2)
{
EditorGUI.PropertyField(originalPosition, usageTypeProperty, GUIContent.none, true);
}