修复Line开启clip时绘制的顶点数可能反而增加的问题

This commit is contained in:
monitor1394
2023-12-25 23:05:06 +08:00
parent cbd527316e
commit 178215d980
8 changed files with 43 additions and 14 deletions

View File

@@ -254,6 +254,27 @@ namespace XCharts.Runtime
else if (pos.y > context.y + context.height) pos.y = context.y + context.height;
}
/// <summary>
/// Determines whether a given line segment will not intersect the Grid boundary at all.
/// ||判断给定的线段是否与Grid边界是否完全不会相交。
/// </summary>
/// <param name="sp"></param>
/// <param name="ep"></param>
/// <returns></returns>
[Since("v3.10.0")]
public bool NotAnyIntersect(Vector3 sp, Vector3 ep)
{
if (sp.x < context.x && ep.x < context.x)
return true;
if (sp.x > context.x + context.width && ep.x > context.x + context.width)
return true;
if (sp.y < context.y && ep.y < context.y)
return true;
if (sp.y > context.y + context.height && ep.y > context.y + context.height)
return true;
return false;
}
/// <summary>
/// 给定的线段和Grid边界的交点
/// </summary>