Pivot can now be used as reference point when drawing lines

pull/489/head
Pontus Andersson 2025-04-07 10:05:11 +02:00
parent 35b9985bf2
commit 331d8cbbd8
1 changed files with 8 additions and 0 deletions

View File

@ -16,6 +16,7 @@ namespace UnityEngine.UI.Extensions
public float LineThickness = 2;
public bool UseMargins;
public bool UsePivot;
public Vector2 Margin;
public bool relativeSize;
@ -88,6 +89,13 @@ namespace UnityEngine.UI.Extensions
pointList.Add(capPoint);
pointList.Add(m_points[m_points.Length - 1]);
// should points be rendered from the pivot
if (UsePivot)
{
offsetX += rectTransform.sizeDelta.x * rectTransform.pivot.x;
offsetY += rectTransform.sizeDelta.y * rectTransform.pivot.y;
}
var Tempm_points = pointList.ToArray();
if (UseMargins)
{