Skip to content

Fix for attribute messing up when changing IndentLevel in CustomEditor #3

Description

@LegendaryZotar

While making my custom editor i encountered a problem, When changing the "IndentLevel" it messes up the slider.

Before:

Before Image

To fix this you can add 3 lines to the drawer (Packages/Simple MinMax Slider/Scripts/Editor/MinMaxSliderDrawer.cs)

1

Right after the comment around line #15 "//PrefixLabel returns the rect of the right part of the..."

int temp = EditorGUI.indentLevel;

2

Just below the first one, right after Rect[] splittedRect = SplitRect(controlRect,3);

EditorGUI.indentLevel = 0;

3

At the end of the OnGUI function, right after the if statement

EditorGUI.indentLevel = temp;

After

After Image

Hope this helps and maybe it can be included in the master repo :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions