修复报错

This commit is contained in:
monitor1394
2020-02-08 15:16:28 +08:00
parent ad46232401
commit 11a68d9b7b
2 changed files with 9 additions and 2 deletions

View File

@@ -131,7 +131,7 @@ namespace XCharts
m_FontSize == other.fontSize &&
m_FontStyle == other.fontStyle &&
m_ForceENotation == other.forceENotation &&
m_Formatter.Equals(other.formatter) &&
ChartHelper.IsValueEqualsString(m_Formatter, other.formatter) &&
m_TextLimit.Equals(other.textLimit);
}
@@ -142,7 +142,7 @@ namespace XCharts
public void SetRelatedText(Text txt, float labelWidth)
{
m_TextLimit.SetRelatedText(txt,labelWidth);
m_TextLimit.SetRelatedText(txt, labelWidth);
}
public string GetFormatterContent(string category)

View File

@@ -370,6 +370,13 @@ namespace XCharts
color1.r == color2.r;
}
public static bool IsValueEqualsString(string str1, string str2)
{
if (str1 == null && str2 == null) return true;
else if (str1 != null && str2 != null) return str1.Equals(str2);
else return false;
}
public static bool IsValueEqualsVector2(Vector2 v1, Vector2 v2)
{
return v1.x == v2.x && v1.y == v2.y;