mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-16 21:40:41 +00:00
修复鼠标不在区域内Tooltip还显示的问题
This commit is contained in:
@@ -312,7 +312,16 @@ namespace XCharts
|
||||
|
||||
private void CheckTooltip()
|
||||
{
|
||||
if (!m_Tooltip.show || !m_Tooltip.isInited) return;
|
||||
if (!m_Tooltip.show || !m_Tooltip.isInited)
|
||||
{
|
||||
if(m_Tooltip.dataIndex != 0)
|
||||
{
|
||||
m_Tooltip.dataIndex = 0;
|
||||
m_Tooltip.SetActive(false);
|
||||
RefreshChart();
|
||||
}
|
||||
return;
|
||||
}
|
||||
m_Tooltip.SetLabelActive(m_Tooltip.crossLabel);
|
||||
m_Tooltip.dataIndex = 0;
|
||||
|
||||
@@ -320,11 +329,16 @@ namespace XCharts
|
||||
|
||||
if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform,
|
||||
Input.mousePosition, null, out local))
|
||||
{
|
||||
m_Tooltip.SetActive(false);
|
||||
return;
|
||||
|
||||
}
|
||||
if (local.x < 0 || local.x > chartWidth ||
|
||||
local.y < 0 || local.y > chartHeight)
|
||||
{
|
||||
m_Tooltip.SetActive(false);
|
||||
return;
|
||||
}
|
||||
m_Tooltip.pointerPos = local;
|
||||
CheckTootipArea(local);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user