From 0e25a23ed22cbe993be9d97c5046993c1810b80b Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Thu, 17 Feb 2022 08:29:57 +0800 Subject: [PATCH] Fixed axis split line bug #181 --- Assets/XCharts/CHANGELOG-EN.md | 1 + Assets/XCharts/CHANGELOG.md | 1 + Assets/XCharts/Runtime/Internal/CoordinateChart.cs | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/XCharts/CHANGELOG-EN.md b/Assets/XCharts/CHANGELOG-EN.md index 8dab8a1f..673f0ebc 100644 --- a/Assets/XCharts/CHANGELOG-EN.md +++ b/Assets/XCharts/CHANGELOG-EN.md @@ -42,6 +42,7 @@ ## branch-2.0 +* (2022.02.17) Fixed bug where axis split line might be displayed outside the coordinate system #181 * (2022.02.08) Fixed {d} formatter error when value is 0 * (2022.02.08) Fixed `YAxis` `AxisLabel`'s `onZero` does not work * (2022.01.06) Improved `Zebra` bar chart diff --git a/Assets/XCharts/CHANGELOG.md b/Assets/XCharts/CHANGELOG.md index 668e1569..bdea7376 100644 --- a/Assets/XCharts/CHANGELOG.md +++ b/Assets/XCharts/CHANGELOG.md @@ -42,6 +42,7 @@ ## branch-2.0 +* (2022.02.17) 修复`Axis`的`SplitLine`可能会显示在坐标系外的问题 #181 * (2022.02.08) 修复数据全0时`{d}`显示不正确的问题 * (2022.02.08) 修复`YAxis`的`AxisLabel`的`onZero`参数不生效的问题 * (2022.01.06) 优化`Zebra`斑马柱图 diff --git a/Assets/XCharts/Runtime/Internal/CoordinateChart.cs b/Assets/XCharts/Runtime/Internal/CoordinateChart.cs index 76eb9125..c20e123c 100644 --- a/Assets/XCharts/Runtime/Internal/CoordinateChart.cs +++ b/Assets/XCharts/Runtime/Internal/CoordinateChart.cs @@ -1082,7 +1082,7 @@ private void DrawYAxisSplit(VertexHelper vh, int yAxisIndex, YAxis yAxis) new Vector2(grid.runtimeX, pY + scaleWidth), yAxis.splitArea.GetColor(i, m_Theme.axis)); } - if (yAxis.splitLine.show) + if (yAxis.splitLine.show && pY >= grid.runtimeY) { if (!xAxis.axisLine.show || !xAxis.axisLine.onZero || zeroPos.y != pY) { @@ -1200,7 +1200,7 @@ private void DrawXAxisSplit(VertexHelper vh, int xAxisIndex, XAxis xAxis) new Vector2(pX + scaleWidth, grid.runtimeY), xAxis.splitArea.GetColor(i, m_Theme.axis)); } - if (xAxis.splitLine.show) + if (xAxis.splitLine.show && pX >= grid.runtimeX) { if (!yAxis.axisLine.show || !yAxis.axisLine.onZero || zeroPos.x != pX) {