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 float LineThickness = 2;
|
||||||
public bool UseMargins;
|
public bool UseMargins;
|
||||||
|
public bool UsePivot;
|
||||||
public Vector2 Margin;
|
public Vector2 Margin;
|
||||||
public bool relativeSize;
|
public bool relativeSize;
|
||||||
|
|
||||||
|
@ -88,6 +89,13 @@ namespace UnityEngine.UI.Extensions
|
||||||
pointList.Add(capPoint);
|
pointList.Add(capPoint);
|
||||||
pointList.Add(m_points[m_points.Length - 1]);
|
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();
|
var Tempm_points = pointList.ToArray();
|
||||||
if (UseMargins)
|
if (UseMargins)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue