From 77fd92d2b09f166a228efdf99b4910593da5763b Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Thu, 11 Jun 2020 08:39:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A5=BC=E5=9B=BE=E5=92=8C?= =?UTF-8?q?=E7=8E=AF=E5=BD=A2=E5=9B=BE=E5=8D=A0=E6=AF=94=E5=BE=88=E5=B0=8F?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/XCharts/Runtime/Utility/ChartDrawer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Assets/XCharts/Runtime/Utility/ChartDrawer.cs b/Assets/XCharts/Runtime/Utility/ChartDrawer.cs index 95cad661..d81dc610 100644 --- a/Assets/XCharts/Runtime/Utility/ChartDrawer.cs +++ b/Assets/XCharts/Runtime/Utility/ChartDrawer.cs @@ -815,6 +815,7 @@ namespace XCharts radius -= borderWidth; smoothness = (smoothness < 0 ? 2f : smoothness); int segments = (int)((2 * Mathf.PI * radius) * (Mathf.Abs(toDegree - startDegree) / 360) / smoothness); + if (segments < 1) segments = 1; float startAngle = startDegree * Mathf.Deg2Rad; float toAngle = toDegree * Mathf.Deg2Rad; float realStartAngle = startAngle; @@ -1015,6 +1016,7 @@ namespace XCharts var diffAngle = Mathf.Abs(toDegree - startDegree) * Mathf.Deg2Rad; int segments = (int)((2 * Mathf.PI * outsideRadius) * (diffAngle * Mathf.Rad2Deg / 360) / smoothness); + if (segments < 1) segments = 1; float startAngle = startDegree * Mathf.Deg2Rad; float toAngle = toDegree * Mathf.Deg2Rad;