From 2248b61d03808b3f52bc1bd13670e321470cf6b6 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 4 Jul 2022 13:14:23 +0800 Subject: [PATCH] [bug][axis] fix axis tick error (#209) --- CHANGELOG.md | 1 + Runtime/Component/Axis/AxisHandler.cs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c4a9642..472448c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ ## master +* (2022.07.04) 修复`Axis`在设置`offset`后`Tick`绘制位置异常的问题 (#209) * (2022.07.03) 优化`AxisLabel`的`formatterFunction`自定义委托 * (2022.07.03) 增加`AxisName`的`onZero`参数支持设置坐标轴名称位置是否和Y轴0刻度一致 (#207) * (2022.07.02) 修复`PieChart`用代码动态创建时`Legend`不正常的问题 (#206) diff --git a/Runtime/Component/Axis/AxisHandler.cs b/Runtime/Component/Axis/AxisHandler.cs index cfa52484..44fdaf47 100644 --- a/Runtime/Component/Axis/AxisHandler.cs +++ b/Runtime/Component/Axis/AxisHandler.cs @@ -612,12 +612,12 @@ namespace XCharts if ((axis.axisTick.inside && axis.IsBottom()) || (!axis.axisTick.inside && axis.IsTop())) { - sY = startY + axis.offset + lineWidth; + sY = startY + lineWidth; eY = sY + tickLength; } else { - sY = startY + axis.offset - lineWidth; + sY = startY - lineWidth; eY = sY - tickLength; } @@ -639,12 +639,12 @@ namespace XCharts if ((axis.axisTick.inside && axis.IsLeft()) || (!axis.axisTick.inside && axis.IsRight())) { - sX = startX + axis.offset + lineWidth; + sX = startX + lineWidth; eX = sX + tickLength; } else { - sX = startX + axis.offset - lineWidth; + sX = startX - lineWidth; eX = sX - tickLength; }