修复TriggerTooltip()接口在指定0或最大index时可能无法触发的问题

This commit is contained in:
monitor1394
2023-12-21 22:41:12 +08:00
parent 11bdbba286
commit 3580df9117
3 changed files with 7 additions and 4 deletions

View File

@@ -70,11 +70,13 @@ slug: /changelog
## master
* (2023.12.19) 修复`Legend``LabelStyle``formatter`不生效的问题
* (2023.12.21) 修复`TriggerTooltip()`接口在指定0或最大index时可能无法触发的问题
* (2023.12.19) 修复`Legend``LabelStyle`设置`formatter`后不生效的问题
* (2023.12.12) 增加`Legend``TextLimit`可限制图例显示文本的长度
* (2023.12.11) 修复`Serie`添加`double.MaxValue`时坐标绘制失败的问题
* (2023.12.10) 增加`Serie``minShowLabel`可隐藏小于指定值的`label`
* (2023.12.09) 增加`LevelStyle``LineStyle``depth`支持
* (2023.12.09) 增加`LevelStyle``depth`指定所属层次
* (2023.12.09) 增加`LevelStyle``LineStyle`设置线条样式
* (2023.12.09) 增加`Serie``Link`可用于桑基图添加节点边关系
* (2023.12.05) 增加`ResetChartStatus()`可主动重置图表状态

View File

@@ -203,7 +203,7 @@ namespace XCharts.Runtime
[Since("v3.7.0")]
public bool ContainsX(float x)
{
return x >= context.x && x <= context.x + context.width;
return x >= context.x - 0.01f && x <= context.x + context.width + 0.01f;
}
/// <summary>
@@ -215,7 +215,7 @@ namespace XCharts.Runtime
[Since("v3.7.0")]
public bool ContainsY(float y)
{
return y >= context.y && y <= context.y + context.height;
return y >= context.y - 0.01f && y <= context.y + context.height + 0.01f;
}
/// <summary>

View File

@@ -733,6 +733,7 @@ namespace XCharts.Runtime
[Since("v3.7.0")]
public void CancelTooltip()
{
m_PointerEventData = null;
var tooltip = GetChartComponent<Tooltip>();
if (tooltip != null)
{