mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-28 12:08:46 +00:00
修复Line开启clip时绘制的顶点数可能反而增加的问题
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user