Skip to content

Commit

Permalink
Initial commit (#2384)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpars authored Oct 26, 2020
1 parent c3401c0 commit e162dc7
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,19 +299,23 @@ internal static void HandlePrefixLabelWithIndent(Rect totalPosition, Rect labelP
/// </summary>
internal class IndentScope : GUI.Scope
{
int m_Offset;

public IndentScope(int offset = 16)
{
m_Offset = offset;

// When using EditorGUI.indentLevel++, the clicking on the checkboxes does not work properly due to some issues on the C++ side.
// This scope is a work-around for this issue.
GUILayout.BeginHorizontal();
EditorGUILayout.Space(offset, false);
GUILayout.BeginVertical();
EditorGUIUtility.labelWidth -= offset;
EditorGUIUtility.labelWidth -= m_Offset;
}

protected override void CloseScope()
{
EditorGUIUtility.labelWidth = 0f;
EditorGUIUtility.labelWidth += m_Offset;
GUILayout.EndVertical();
GUILayout.EndHorizontal();
}
Expand Down

0 comments on commit e162dc7

Please sign in to comment.