diff --git a/Assets/Fungus/Scripts/Editor/FlowchartEditor.cs b/Assets/Fungus/Scripts/Editor/FlowchartEditor.cs index 30824776..52d79d61 100644 --- a/Assets/Fungus/Scripts/Editor/FlowchartEditor.cs +++ b/Assets/Fungus/Scripts/Editor/FlowchartEditor.cs @@ -91,7 +91,7 @@ namespace Fungus.EditorUtils //Show the variables in the flowchart inspector GUILayout.Space(20); - DrawVariablesGUI(false, Screen.width - 70); + DrawVariablesGUI(false, Mathf.FloorToInt(EditorGUIUtility.currentViewWidth) - VariableListAdaptor.ReorderListSkirts); } @@ -165,8 +165,10 @@ namespace Fungus.EditorUtils Rect lastRect = buttonRect; lastRect.x += 5; lastRect.y += 5; + //this is not required, seems to be legacy that is hidden in the normal reorderable - //EditorGUI.Foldout(lastRect, true, ""); + if(showVariableToggleButton) + EditorGUI.Foldout(lastRect, true, ""); Rect plusRect = listRect; plusRect.x += plusRect.width - plusWidth; diff --git a/Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs b/Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs index cffe8643..01d9a28c 100644 --- a/Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs +++ b/Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs @@ -15,6 +15,8 @@ namespace Fungus.EditorUtils public class VariableListAdaptor : IReorderableListAdaptor { public static readonly int DefaultWidth = 80 + 100 + 140 + 60; + public static readonly int ScrollSpacer = 8; + public static readonly int ReorderListSkirts = 70; protected SerializedProperty _arrayProperty; @@ -38,7 +40,7 @@ namespace Fungus.EditorUtils this._arrayProperty = arrayProperty; this.fixedItemHeight = fixedItemHeight; - this.widthOfList = widthOfList; + this.widthOfList = widthOfList - ScrollSpacer; } public VariableListAdaptor(SerializedProperty arrayProperty) : this(arrayProperty, 0f, DefaultWidth) {