mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-21 23:58:49 -05:00
* fix: #353 while keeping #289 fixed * Fix height of popup (was covering click area of expanded type's properties) Co-authored-by: Adam Ramberg <adam@mambojambostudios.com>
This commit is contained in:
parent
a41a7f4abe
commit
b2e302498d
@ -56,6 +56,7 @@ namespace UnityAtoms.Editor
|
|||||||
// Calculate rect for configuration button
|
// Calculate rect for configuration button
|
||||||
Rect buttonRect = new Rect(position);
|
Rect buttonRect = new Rect(position);
|
||||||
buttonRect.yMin += _popupStyle.margin.top;
|
buttonRect.yMin += _popupStyle.margin.top;
|
||||||
|
buttonRect.yMax = buttonRect.yMin + EditorGUIUtility.singleLineHeight;
|
||||||
buttonRect.width = _popupStyle.fixedWidth + _popupStyle.margin.right;
|
buttonRect.width = _popupStyle.fixedWidth + _popupStyle.margin.right;
|
||||||
position.xMin = buttonRect.xMax;
|
position.xMin = buttonRect.xMax;
|
||||||
|
|
||||||
@ -70,9 +71,14 @@ namespace UnityAtoms.Editor
|
|||||||
var usageTypePropertyName = GetUsages(property)[newUsageValue].PropertyName;
|
var usageTypePropertyName = GetUsages(property)[newUsageValue].PropertyName;
|
||||||
var usageTypeProperty = property.FindPropertyRelative(usageTypePropertyName);
|
var usageTypeProperty = property.FindPropertyRelative(usageTypePropertyName);
|
||||||
|
|
||||||
if (usageTypePropertyName == "_value")
|
var expanded = usageTypeProperty.isExpanded;
|
||||||
|
usageTypeProperty.isExpanded = true;
|
||||||
|
var valueFieldHeight = EditorGUI.GetPropertyHeight(usageTypeProperty, label);
|
||||||
|
usageTypeProperty.isExpanded = expanded;
|
||||||
|
|
||||||
|
if (usageTypePropertyName == "_value" && valueFieldHeight > EditorGUIUtility.singleLineHeight + 2)
|
||||||
{
|
{
|
||||||
EditorGUI.PropertyField(usageTypeProperty.hasChildren ? originalPosition : position, usageTypeProperty, GUIContent.none, true);
|
EditorGUI.PropertyField(originalPosition, usageTypeProperty, GUIContent.none, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user