修复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

@@ -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)
{