Pivot can now be used as reference point when drawing lines
parent
35b9985bf2
commit
331d8cbbd8
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue