mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-28 03:58:49 +00:00
修复PieChart边框大小不一致的问题
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
* (2020.09.22) Fixed `PieChart` inconsistent border size
|
||||||
* (2020.09.18) Added `Remove All Chart Object` to Remove All child nodes under the Chart (automatically reinitialized)
|
* (2020.09.18) Added `Remove All Chart Object` to Remove All child nodes under the Chart (automatically reinitialized)
|
||||||
* (2020.09.18) Fixed `SerieLabel` also displayed after hided `Serie` by clicked the legend #94
|
* (2020.09.18) Fixed `SerieLabel` also displayed after hided `Serie` by clicked the legend #94
|
||||||
* (2020.09.18) Optimize coordinate axis calibration and text display #93
|
* (2020.09.18) Optimize coordinate axis calibration and text display #93
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
* (2020.09.22) 修复`PieChart`边框大小不一致的问题
|
||||||
* (2020.09.19) 发布`v1.6.1`版本
|
* (2020.09.19) 发布`v1.6.1`版本
|
||||||
* (2020.09.19) 增加`Remove All Chart Object`移除图表下的所有子节点(会自动重新初始化)
|
* (2020.09.19) 增加`Remove All Chart Object`移除图表下的所有子节点(会自动重新初始化)
|
||||||
* (2020.09.18) 修复`SerieLabel`在点击图例隐藏`Serie`后还显示的问题#94
|
* (2020.09.18) 修复`SerieLabel`在点击图例隐藏`Serie`后还显示的问题#94
|
||||||
|
|||||||
@@ -865,6 +865,7 @@ namespace XCharts
|
|||||||
var lastColor = color;
|
var lastColor = color;
|
||||||
var needBorder = borderWidth != 0;
|
var needBorder = borderWidth != 0;
|
||||||
var needSpace = space != 0;
|
var needSpace = space != 0;
|
||||||
|
var borderLineWidth = needSpace ? borderWidth : borderWidth / 2;
|
||||||
var lastPos = Vector3.zero;
|
var lastPos = Vector3.zero;
|
||||||
var middleDire = ChartHelper.GetDire(startAngle + halfAngle);
|
var middleDire = ChartHelper.GetDire(startAngle + halfAngle);
|
||||||
if (needBorder || needSpace)
|
if (needBorder || needSpace)
|
||||||
@@ -884,9 +885,9 @@ namespace XCharts
|
|||||||
}
|
}
|
||||||
if (needBorder)
|
if (needBorder)
|
||||||
{
|
{
|
||||||
borderDiff = borderWidth / Mathf.Sin(halfAngle);
|
borderDiff = borderLineWidth / Mathf.Sin(halfAngle);
|
||||||
realCenter += borderDiff * middleDire;
|
realCenter += borderDiff * middleDire;
|
||||||
borderAngle = 2 * Mathf.Asin(borderWidth / (2 * radius));
|
borderAngle = 2 * Mathf.Asin(borderLineWidth / (2 * radius));
|
||||||
realStartAngle = realStartAngle + borderAngle;
|
realStartAngle = realStartAngle + borderAngle;
|
||||||
realToAngle = realToAngle - borderAngle;
|
realToAngle = realToAngle - borderAngle;
|
||||||
if (realToAngle < realStartAngle)
|
if (realToAngle < realStartAngle)
|
||||||
@@ -963,8 +964,6 @@ namespace XCharts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void DrawRoundCap(VertexHelper vh, Vector3 center, float width, float radius, float angle,
|
public static void DrawRoundCap(VertexHelper vh, Vector3 center, float width, float radius, float angle,
|
||||||
bool clockwise, Color32 color, bool end)
|
bool clockwise, Color32 color, bool end)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user