增加SerieLabelautoOffset参数设置是否自动判断上下偏移

This commit is contained in:
monitor1394
2020-06-04 12:33:25 +08:00
parent be20dc2474
commit 01f8856106
6 changed files with 21 additions and 3 deletions

View File

@@ -44,6 +44,7 @@ namespace XCharts
SerializedProperty m_BorderWidth = prop.FindPropertyRelative("m_BorderWidth");
SerializedProperty m_BorderColor = prop.FindPropertyRelative("m_BorderColor");
SerializedProperty m_NumericFormatter = prop.FindPropertyRelative("m_NumericFormatter");
SerializedProperty m_AutoOffset = prop.FindPropertyRelative("m_AutoOffset");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SerieLabelToggle, prop, null, show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
@@ -56,6 +57,8 @@ namespace XCharts
EditorGUI.PropertyField(drawRect, m_Offset);
drawRect.y += EditorGUI.GetPropertyHeight(m_Offset);
EditorGUI.PropertyField(drawRect, m_AutoOffset);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Margin);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Formatter);
@@ -107,7 +110,7 @@ namespace XCharts
float height = 0;
if (ChartEditorHelper.IsToggle(m_SerieLabelToggle, prop))
{
height += 23 * EditorGUIUtility.singleLineHeight + 22 * EditorGUIUtility.standardVerticalSpacing;
height += 24 * EditorGUIUtility.singleLineHeight + 23 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Offset"));
}
else