mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 10:20:10 +00:00
修复饼图和环形图占比很小时不显示的问题
This commit is contained in:
@@ -815,6 +815,7 @@ namespace XCharts
|
|||||||
radius -= borderWidth;
|
radius -= borderWidth;
|
||||||
smoothness = (smoothness < 0 ? 2f : smoothness);
|
smoothness = (smoothness < 0 ? 2f : smoothness);
|
||||||
int segments = (int)((2 * Mathf.PI * radius) * (Mathf.Abs(toDegree - startDegree) / 360) / 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 startAngle = startDegree * Mathf.Deg2Rad;
|
||||||
float toAngle = toDegree * Mathf.Deg2Rad;
|
float toAngle = toDegree * Mathf.Deg2Rad;
|
||||||
float realStartAngle = startAngle;
|
float realStartAngle = startAngle;
|
||||||
@@ -1015,6 +1016,7 @@ namespace XCharts
|
|||||||
var diffAngle = Mathf.Abs(toDegree - startDegree) * Mathf.Deg2Rad;
|
var diffAngle = Mathf.Abs(toDegree - startDegree) * Mathf.Deg2Rad;
|
||||||
|
|
||||||
int segments = (int)((2 * Mathf.PI * outsideRadius) * (diffAngle * Mathf.Rad2Deg / 360) / smoothness);
|
int segments = (int)((2 * Mathf.PI * outsideRadius) * (diffAngle * Mathf.Rad2Deg / 360) / smoothness);
|
||||||
|
if (segments < 1) segments = 1;
|
||||||
float startAngle = startDegree * Mathf.Deg2Rad;
|
float startAngle = startDegree * Mathf.Deg2Rad;
|
||||||
float toAngle = toDegree * Mathf.Deg2Rad;
|
float toAngle = toDegree * Mathf.Deg2Rad;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user