From 1d1ad6fa57e63459927b5bf85e5ee8432b0bec4e Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Wed, 8 Jun 2022 08:32:29 +0800 Subject: [PATCH] [bug] fix axis label active --- CHANGELOG.md | 2 ++ Runtime/Component/Axis/AxisHandler.cs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c65799c9..1451d2fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,8 @@ ## master +* (2022.06.08) 修复`Axis`的`AxisLabel`在设置不显示时还显示首尾两个`label`的问题 + ## v3.0.0 * 更健壮的底层框架。 diff --git a/Runtime/Component/Axis/AxisHandler.cs b/Runtime/Component/Axis/AxisHandler.cs index 1256289b..109fa876 100644 --- a/Runtime/Component/Axis/AxisHandler.cs +++ b/Runtime/Component/Axis/AxisHandler.cs @@ -300,6 +300,11 @@ namespace XCharts internal void CheckValueLabelActive(Axis axis, int i, ChartLabel label, Vector3 pos) { + if (!axis.show || !axis.axisLabel.show) + { + label.SetTextActive(false); + return; + } if (axis.IsValue()) { if (orient == Orient.Horizonal)