Skip to content

Commit 86161ee

Browse files
committed
FIx int field + float field label
1 parent 9797c74 commit 86161ee

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Assets/com.alelievr.NodeGraphProcessor/Editor/Utils/ExposedParameterDrawer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
5959
var max = settings.FindPropertyRelative(nameof(FloatParameter.FloatSettings.max));
6060
container.Add(new IMGUIContainer(() => {
6161
float newValue;
62+
EditorGUIUtility.labelWidth = 150;
6263
if ((FloatParameter.FloatMode)mode.enumValueIndex == FloatParameter.FloatMode.Slider)
6364
{
6465
newValue = EditorGUILayout.Slider(name.stringValue, val.floatValue, min.floatValue, max.floatValue);
@@ -71,6 +72,7 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
7172
val.floatValue = newValue;
7273
ApplyModifiedProperties(property);
7374
}
75+
EditorGUIUtility.labelWidth = 0;
7476
}));
7577

7678
return container;
@@ -99,7 +101,7 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
99101
}
100102
else
101103
newValue = EditorGUILayout.IntField(name.stringValue, val.intValue);
102-
if (newValue != val.floatValue)
104+
if (newValue != val.intValue)
103105
{
104106
val.intValue = newValue;
105107
ApplyModifiedProperties(property);

Assets/com.alelievr.NodeGraphProcessor/Runtime/Elements/ExposedParameter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ public enum IntMode
251251
public class IntSettings : Settings
252252
{
253253
public IntMode mode;
254-
public int min;
255-
public int max;
254+
public int min = 0;
255+
public int max = 10;
256256

257257
public override bool Equals(Settings param)
258258
=> base.Equals(param) && mode == ((IntSettings)param).mode && min == ((IntSettings)param).min && max == ((IntSettings)param).max;

0 commit comments

Comments
 (0)