增加AxisLabelonZero参数可将Label显示在0刻度上

This commit is contained in:
monitor1394
2020-04-19 22:08:40 +08:00
parent 42eec0c3e3
commit d93a62608c
6 changed files with 20 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ namespace XCharts
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
SerializedProperty m_ForceENotation = prop.FindPropertyRelative("m_ForceENotation");
SerializedProperty m_ShowAsPositiveNumber = prop.FindPropertyRelative("m_ShowAsPositiveNumber");
SerializedProperty m_OnZero = prop.FindPropertyRelative("m_OnZero");
SerializedProperty m_TextLimit = prop.FindPropertyRelative("m_TextLimit");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AxisLabelToggle, prop, "Axis Label", show, false);
@@ -38,6 +39,8 @@ namespace XCharts
if (ChartEditorHelper.IsToggle(m_AxisLabelToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_OnZero);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Inside);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Interval);
@@ -69,7 +72,7 @@ namespace XCharts
float height = 0;
if (ChartEditorHelper.IsToggle(m_AxisLabelToggle, prop))
{
height += 11 * EditorGUIUtility.singleLineHeight + 10 * EditorGUIUtility.standardVerticalSpacing;
height += 12 * EditorGUIUtility.singleLineHeight + 11 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TextLimit"));
}
return height;

View File

@@ -66,7 +66,8 @@ namespace XCharts
float height = 0;
if (ChartEditorHelper.IsToggle(m_AxisNameToggle, prop))
{
height += 7 * EditorGUIUtility.singleLineHeight + 6 * EditorGUIUtility.standardVerticalSpacing;
height += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Offset"));
}
return height;
}