mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-30 05:08:48 +00:00
修复Pie只有一个数据时设置border后显示异常的问题 (#237)
This commit is contained in:
@@ -65,6 +65,7 @@ slug: /changelog
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
* (2022.12.28) 修复`Pie`只有一个数据时设置`border`后显示异常的问题 (#237)
|
||||||
* (2022.12.22) 调整`Covert`重命名为`Convert`,涉及的接口有:`ConvertXYAxis()`,`CovertSerie()`等
|
* (2022.12.22) 调整`Covert`重命名为`Convert`,涉及的接口有:`ConvertXYAxis()`,`CovertSerie()`等
|
||||||
* (2022.12.22) 修复`Convert XY Axis`后Y轴的`Label`显示异常的问题
|
* (2022.12.22) 修复`Convert XY Axis`后Y轴的`Label`显示异常的问题
|
||||||
* (2022.12.12) 修复`Axis`的`Value`轴在某些情况下计算数值范围不准确的问题
|
* (2022.12.12) 修复`Axis`的`Value`轴在某些情况下计算数值范围不准确的问题
|
||||||
|
|||||||
@@ -1323,7 +1323,8 @@ namespace XUGL
|
|||||||
float smoothness, int gradientType = 0, bool isYAxis = false)
|
float smoothness, int gradientType = 0, bool isYAxis = false)
|
||||||
{
|
{
|
||||||
if (radius == 0) return;
|
if (radius == 0) return;
|
||||||
if (gap > 0 && Mathf.Abs(toDegree - startDegree) >= 360) gap = 0;
|
var isCircle = Mathf.Abs(toDegree - startDegree) >= 360;
|
||||||
|
if (gap > 0 && isCircle) gap = 0;
|
||||||
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);
|
||||||
@@ -1363,7 +1364,7 @@ namespace XUGL
|
|||||||
if (realToAngle < realStartAngle) realToAngle = realStartAngle;
|
if (realToAngle < realStartAngle) realToAngle = realStartAngle;
|
||||||
p2 = UGLHelper.GetPos(center, radius, realStartAngle);
|
p2 = UGLHelper.GetPos(center, radius, realStartAngle);
|
||||||
}
|
}
|
||||||
if (needBorder)
|
if (needBorder && !isCircle)
|
||||||
{
|
{
|
||||||
borderDiff = borderLineWidth / Mathf.Sin(halfAngle);
|
borderDiff = borderLineWidth / Mathf.Sin(halfAngle);
|
||||||
realCenter += borderDiff * middleDire;
|
realCenter += borderDiff * middleDire;
|
||||||
@@ -1514,6 +1515,7 @@ namespace XUGL
|
|||||||
insideRadius += borderWidth;
|
insideRadius += borderWidth;
|
||||||
smoothness = smoothness < 0 ? 2f : smoothness;
|
smoothness = smoothness < 0 ? 2f : smoothness;
|
||||||
Vector3 p1, p2, p3, p4, e1, e2;
|
Vector3 p1, p2, p3, p4, e1, e2;
|
||||||
|
var isCircle = Mathf.Abs(toDegree - startDegree) >= 360;
|
||||||
var needBorder = borderWidth != 0;
|
var needBorder = borderWidth != 0;
|
||||||
var needSpace = gap != 0;
|
var needSpace = gap != 0;
|
||||||
var diffAngle = Mathf.Abs(toDegree - startDegree) * Mathf.Deg2Rad;
|
var diffAngle = Mathf.Abs(toDegree - startDegree) * Mathf.Deg2Rad;
|
||||||
@@ -1581,7 +1583,7 @@ namespace XUGL
|
|||||||
p2 = UGLHelper.GetPos(center, outsideRadius, realStartOutAngle, false);
|
p2 = UGLHelper.GetPos(center, outsideRadius, realStartOutAngle, false);
|
||||||
e2 = UGLHelper.GetPos(center, outsideRadius, realToOutAngle, false);
|
e2 = UGLHelper.GetPos(center, outsideRadius, realToOutAngle, false);
|
||||||
}
|
}
|
||||||
if (needBorder)
|
if (needBorder && !isCircle)
|
||||||
{
|
{
|
||||||
var borderDiff = borderWidth / Mathf.Sin(halfAngle);
|
var borderDiff = borderWidth / Mathf.Sin(halfAngle);
|
||||||
realCenter += Mathf.Abs(borderDiff) * middleDire;
|
realCenter += Mathf.Abs(borderDiff) * middleDire;
|
||||||
|
|||||||
Reference in New Issue
Block a user