diff --git a/Runtime/Component/Interaction/InteractData.cs b/Runtime/Component/Interaction/InteractData.cs index b403b7d2..b14cd98d 100644 --- a/Runtime/Component/Interaction/InteractData.cs +++ b/Runtime/Component/Interaction/InteractData.cs @@ -34,13 +34,13 @@ namespace XCharts.Runtime SetValue(ref needInteract, value); } - public void SetValue(ref bool needInteract, float value) + public void SetValue(ref bool needInteract, float value, bool previousValueZero = false) { if (m_TargetValue != value) { needInteract = true; if (!m_ValueEnable) - m_PreviousValue = value; + m_PreviousValue = previousValueZero ? 0 : value; else m_PreviousValue = m_CurrentValue; UpdateStart(); @@ -52,19 +52,6 @@ namespace XCharts.Runtime } } - public void SetValue(float value) - { - if (m_TargetValue != value) - { - if (!m_ValueEnable) - m_PreviousValue = value; - else - m_PreviousValue = m_CurrentValue; - UpdateStart(); - m_TargetValue = value; - } - } - public void SetPosition(ref bool needInteract, Vector3 pos) { if (m_TargetPosition != pos) diff --git a/Runtime/Serie/Scatter/BaseScatterHandler.cs b/Runtime/Serie/Scatter/BaseScatterHandler.cs index bf611e31..21a264a2 100644 --- a/Runtime/Serie/Scatter/BaseScatterHandler.cs +++ b/Runtime/Serie/Scatter/BaseScatterHandler.cs @@ -180,7 +180,8 @@ namespace XCharts.Runtime if (!serieData.interact.TryGetValue(ref symbolSize, ref interacting, interactDuration)) { symbolSize = SerieHelper.GetSysmbolSize(serie, serieData, chart.theme.serie.scatterSymbolSize, state); - serieData.interact.SetValue(ref interacting, symbolSize); + serieData.interact.SetValue(ref interacting, symbolSize, true); + serieData.interact.TryGetValue(ref symbolSize, ref interacting, interactDuration); } symbolSize *= rate; @@ -198,7 +199,6 @@ namespace XCharts.Runtime } else { - if (symbolSize > 100) symbolSize = 100; chart.DrawSymbol(vh, symbol.type, symbolSize, symbolBorder, pos, color, toColor, emptyColor, borderColor, symbol.gap, cornerRadius); } diff --git a/Runtime/Serie/SerieHandler.cs b/Runtime/Serie/SerieHandler.cs index ccfb11e0..c192ed8f 100644 --- a/Runtime/Serie/SerieHandler.cs +++ b/Runtime/Serie/SerieHandler.cs @@ -143,7 +143,6 @@ namespace XCharts.Runtime if (serie.vertsDirty) { chart.RefreshPainter(serie); - serie.ResetInteract(); serie.ClearVerticesDirty(); } if (serie.interactDirty) diff --git a/Runtime/Serie/SerieHelper.cs b/Runtime/Serie/SerieHelper.cs index 95dab42e..b5dc4a37 100644 --- a/Runtime/Serie/SerieHelper.cs +++ b/Runtime/Serie/SerieHelper.cs @@ -673,7 +673,7 @@ namespace XCharts.Runtime } } - public static float GetSysmbolSize(Serie serie, SerieData serieData, float defaultSize, SerieState state = SerieState.Auto) + public static float GetSysmbolSize(Serie serie, SerieData serieData, float defaultSize, SerieState state = SerieState.Auto, bool checkAnimation = false) { if (serie == null) return defaultSize; if (state == SerieState.Auto) @@ -699,7 +699,7 @@ namespace XCharts.Runtime var symbol = stateStyle.symbol; size = symbol.GetSize(serieData == null ? null : serieData.data, defaultSize); } - if (serieData != null) + if (serieData != null && checkAnimation) { size = (float)serieData.GetAddAnimationData(0, size, serie.animation.GetAdditionDuration()); }