Skip to content

Commit 8893a55

Browse files
committed
Fix indentation issues while drawing FormattedNumber
1 parent 8f5d822 commit 8893a55

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

Assets/Editor Toolbox/Editor/Drawers/Regular/FormattedNumberAttributeDrawer.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
namespace Toolbox.Editor.Drawers
88
{
9+
using Toolbox.Editor.Internal;
10+
911
[CustomPropertyDrawer(typeof(FormattedNumberAttribute))]
1012
public class FormattedNumberAttributeDrawer : PropertyDrawerBase
1113
{
@@ -27,7 +29,7 @@ private bool IsControlEditing(string propertyKey)
2729
return EditorGUIUtility.editingTextField && GUI.GetNameOfFocusedControl() == propertyKey;
2830
}
2931

30-
private Single GetSingle(SerializedProperty property)
32+
private float GetSingle(SerializedProperty property)
3133
{
3234
return property.propertyType == SerializedPropertyType.Integer
3335
? property.intValue
@@ -62,7 +64,10 @@ protected override void OnGUISafe(Rect position, SerializedProperty property, GU
6264

6365
try
6466
{
65-
EditorGUI.TextField(position, single.ToString(format, formatInfo));
67+
using (new ZeroIndentScope())
68+
{
69+
EditorGUI.TextField(position, single.ToString(format, formatInfo));
70+
}
6671
}
6772
catch (FormatException)
6873
{

0 commit comments

Comments
 (0)