diff --git a/Assets/XCharts/CHANGELOG-EN.md b/Assets/XCharts/CHANGELOG-EN.md index cb73c420..ff2b32cc 100644 --- a/Assets/XCharts/CHANGELOG-EN.md +++ b/Assets/XCharts/CHANGELOG-EN.md @@ -32,6 +32,8 @@ ## Latest +* (2021.03.18) Fixed an issue where the check box after `Foldout` in `Inspector` could not be checked +* (2021.03.18) Fixed an issue with `BarChart` displaying an exception in the `0` value * (2021.03.14) Fixed `Tooltip` indicator was not indicating the correct location in some cases * (2021.03.13) Optimized the editing experience and component refresh after `MulticomponentMode` is enabled #128 * (2021.03.10) Added `CandlestickChart` #124 diff --git a/Assets/XCharts/CHANGELOG.md b/Assets/XCharts/CHANGELOG.md index 240d02bb..1055b00c 100644 --- a/Assets/XCharts/CHANGELOG.md +++ b/Assets/XCharts/CHANGELOG.md @@ -32,7 +32,8 @@ ## Latest -* (2021.03.18) 修复`BarChart`在 `0` 数值时显示异常的问题 +* (2021.03.18) 修复`Inspector`下`Foldout`后的勾选框无法选中的问题 +* (2021.03.18) 修复`BarChart`在`0`数值时显示异常的问题 * (2021.03.14) 修复`Tooltip`的指示器在某些情况下指示位置不准的问题 * (2021.03.13) 优化`MultiComponentMode`开启后的编辑体验和组件刷新 #128 * (2021.03.10) 增加`CandlestickChart`K线图 #124 diff --git a/Assets/XCharts/Editor/PropertyDrawers/SerieDrawer.cs b/Assets/XCharts/Editor/PropertyDrawers/SerieDrawer.cs index f2cbed49..cee241b9 100644 --- a/Assets/XCharts/Editor/PropertyDrawers/SerieDrawer.cs +++ b/Assets/XCharts/Editor/PropertyDrawers/SerieDrawer.cs @@ -212,7 +212,7 @@ namespace XCharts SerializedProperty m_ShowDataIcon = prop.FindPropertyRelative("m_ShowDataIcon"); int index = InitToggle(prop); drawRect.width = EditorGUIUtility.labelWidth + 10; - m_DataFoldout[index] = EditorGUI.Foldout(drawRect, m_DataFoldout[index], "Data"); + m_DataFoldout[index] = EditorGUI.Foldout(drawRect, m_DataFoldout[index], "Data", true); drawRect.width = pos.width; AddSingleLineHeight(); @@ -222,8 +222,8 @@ namespace XCharts float nameWid = 45; #if UNITY_2019_3_OR_NEWER - var gap = 2; - var namegap = 3; + var gap = 2; + var namegap = 3; #else var gap = 0; var namegap = 0; diff --git a/Assets/XCharts/Editor/Utility/ChartEditorHelper.cs b/Assets/XCharts/Editor/Utility/ChartEditorHelper.cs index 4ef9d4b4..9ae2aea9 100644 --- a/Assets/XCharts/Editor/Utility/ChartEditorHelper.cs +++ b/Assets/XCharts/Editor/Utility/ChartEditorHelper.cs @@ -142,7 +142,7 @@ public class ChartEditorHelper float defaultX = drawRect.x; var style = bold ? Styles.foldoutStyle : EditorStyles.foldout; drawRect.width = EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH; - moduleToggle = EditorGUI.Foldout(drawRect, moduleToggle, content, style); + moduleToggle = EditorGUI.Foldout(drawRect, moduleToggle, content, true, style); MakeBool(drawRect, prop); drawRect.width = defaultWidth; drawRect.x = defaultX; @@ -156,7 +156,7 @@ public class ChartEditorHelper float defaultX = drawRect.x; var style = bold ? Styles.foldoutStyle : EditorStyles.foldout; drawRect.width = EditorGUIUtility.labelWidth; - moduleToggle[key] = EditorGUI.Foldout(drawRect, moduleToggle[key], content, style); + moduleToggle[key] = EditorGUI.Foldout(drawRect, moduleToggle[key], content, true, style); if (prop != null) { if (prop.propertyType == SerializedPropertyType.Boolean) @@ -236,7 +236,8 @@ public class ChartEditorHelper drawRect.width = EditorGUIUtility.labelWidth; #endif var displayName = string.IsNullOrEmpty(moduleName) ? prop.displayName : moduleName; - toggle = EditorGUI.Foldout(drawRect, toggle, displayName, bold ? Styles.foldoutStyle : EditorStyles.foldout); + var foldoutStyle = bold ? Styles.foldoutStyle : EditorStyles.foldout; + toggle = EditorGUI.Foldout(drawRect, toggle, displayName, true, foldoutStyle); if (moduleToggle[key] != toggle) { @@ -276,7 +277,7 @@ public class ChartEditorHelper { var rawWidth = drawRect.width; drawRect.width = EditorGUIUtility.labelWidth + 10; - bool flag = EditorGUI.Foldout(drawRect, foldout, listProp.displayName); + bool flag = EditorGUI.Foldout(drawRect, foldout, listProp.displayName, true); height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; drawRect.width = rawWidth;