Skip to content

Commit

Permalink
exposed vertical spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris committed Apr 18, 2017
1 parent 854ea97 commit 1a0fc81
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Assets/ReorderableList/List/Editor/ReorderableList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public enum ElementDisplayType {
public float headerHeight;
public float footerHeight;
public float slideEasing;
public float verticalSpacing;
public bool showDefaultBackground;
public ElementDisplayType elementDisplayType;
public string elementNameProperty;
Expand Down Expand Up @@ -130,6 +131,11 @@ public ReorderableList(SerializedProperty list, bool canAdd, bool canRemove, boo
list.isExpanded = true;
label = new GUIContent(list.displayName);

#if UNITY_5_6_OR_NEWER
verticalSpacing = EditorGUIUtility.standardVerticalSpacing;
#else
verticalSpacing = 2f;
#endif
headerHeight = 18f;
footerHeight = 13f;
slideEasing = 0.15f;
Expand Down Expand Up @@ -439,7 +445,7 @@ private Rect GetElementDrawRect(int index, Rect desiredRect) {
private Rect GetElementHeaderRect(SerializedProperty element, Rect elementRect) {

Rect rect = elementRect;
rect.height = EditorGUIUtility.singleLineHeight + 2;
rect.height = EditorGUIUtility.singleLineHeight + verticalSpacing;

return rect;
}
Expand Down Expand Up @@ -559,7 +565,7 @@ private void UpdateElementRects(Rect rect, Event evt) {
//start rect

Rect elementRect = rect;
elementRect.yMin = elementRect.yMax = rect.yMin + 2;
elementRect.yMin = elementRect.yMax = rect.yMin + verticalSpacing;

for (i = 0; i < len; i++) {

Expand Down

0 comments on commit 1a0fc81

Please sign in to comment.