Exemplo n.º 1
0
 public void InstanceObject(LineProperties lP)
 {
     if (lP.type == "Arc")
     {
         if (count % 3 == 0 & count != 0)
         {
             //Destroy(GameObject.Find("Master"));
             MasterHolder.GetComponent <DimOnDistroy>().DestroyMe();
             MasterHolder = new GameObject("Master");
             MasterHolder.AddComponent <DimOnDistroy>();
         }
         GameObject center = new GameObject("Center" + count++);
         center.transform.SetParent(MasterHolder.transform);
         CreateKnots(lP.starPosition, lP.endPosition, lP.center.transform.position, center);
         GameObject _temp = Instantiate(prefabText);
         _temp.transform.SetParent(MasterHolder.transform);
         _temp.transform.position = lP.center.transform.position + Vector3.down;
         _temp.GetComponent <TextMeshPro>().text = lP.angle.ToString();
         if (radiouses.Count > 10)
         {
             radiouses.Clear();
             lr.positionCount = 1;
             lr.SetPosition(0, new Vector3(-50, -100, 0));
         }
         radiouses.Add(lP.angle);
     }
 }
Exemplo n.º 2
0
        protected void SetBreakpointLineProperties(LineProperties props, Breakpoint breakpoint)
        {
            DebuggerInfo config       = ConfigManager.Config.Debug.Debugger;
            Color        fgColor      = Color.White;
            Color?       bgColor      = null;
            Color        bpColor      = breakpoint.BreakOnExec ? config.CodeExecBreakpointColor : (breakpoint.BreakOnWrite ? config.CodeWriteBreakpointColor : config.CodeReadBreakpointColor);
            Color        outlineColor = bpColor;
            LineSymbol   symbol;

            if (breakpoint.Enabled)
            {
                bgColor = bpColor;
                symbol  = LineSymbol.Circle;
            }
            else
            {
                fgColor = Color.Black;
                symbol  = LineSymbol.CircleOutline;
            }

            if (breakpoint.MarkEvent)
            {
                symbol |= LineSymbol.Mark;
            }

            if (!string.IsNullOrWhiteSpace(breakpoint.Condition))
            {
                symbol |= LineSymbol.Plus;
            }

            props.FgColor      = fgColor;
            props.TextBgColor  = bgColor;
            props.OutlineColor = outlineColor;
            props.Symbol       = symbol;
        }
Exemplo n.º 3
0
    string CreateComandsS(LineProperties inLine)
    {
        Vector2 inVector = new Vector2(inLine.endPosition.y, inLine.endPosition.x - 70);

        int    scale    = 1;
        string lineType = inLine.type;
        string comand   = "null";

        if (lineType == "Arc")
        {
            if (lineProperties.Count > 1)
            {
                Vector3 pastVector = lineProperties[lineProperties.IndexOf(inLine) - 1].endPosition;
                comand = "G01X" + pastVector.y * scale + "Y" + (pastVector.x - 70) * scale;
            }
            if (inLine.LR == 1)
            {
                comand = "G03X" + inVector.x * scale + "Y" + inVector.y * scale + "R" + inLine.radious * scale;
            }
            if (inLine.LR == -1)
            {
                comand = "G02X" + inVector.x * scale + "Y" + inVector.y * scale + "R" + inLine.radious * scale;
            }
        }
        if (lineType == "Line")
        {
            comand = "G01X" + inVector.x * scale + "Y" + inVector.y * scale;
        }
        return(comand);
    }
Exemplo n.º 4
0
        public override LineProperties GetLineStyle(CodeLineData lineData, int lineIndex)
        {
            DebuggerInfo   cfg   = ConfigManager.Config.Debug.Debugger;
            LineProperties props = new LineProperties();

            if (lineData.Address >= 0)
            {
                GetBreakpointLineProperties(props, lineData.Address);
            }

            bool isActiveStatement = ActiveAddress.HasValue && ActiveAddress.Value == lineData.Address;

            if (isActiveStatement)
            {
                ConfigureActiveStatement(props);
            }

            if (lineData.Flags.HasFlag(LineFlags.VerifiedData))
            {
                props.LineBgColor = cfg.CodeVerifiedDataColor;
            }
            else if (!lineData.Flags.HasFlag(LineFlags.VerifiedCode))
            {
                props.LineBgColor = cfg.CodeUnidentifiedDataColor;
            }

            return(props);
        }
Exemplo n.º 5
0
        private void AddLineProperties(MarkupLine editObject)
        {
            LineProperties = ComponentPool.Get <PropertyGroupPanel>(ContentPanel.Content);
            LineProperties.Init();

            if (editObject is MarkupRegularLine line)
            {
                var aligment     = AddAlignmentProperty(line.RawAlignment, NodeMarkup.Localize.LineEditor_LineAlignment);
                var clipSidewalk = AddClipSidewalkProperty(line);
                LinePropertiesVisibleAction = () =>
                {
                    clipSidewalk.isVisible   = line.PointPair.NetworkType == NetworkType.Road;
                    aligment.isVisible       = IsSplit;
                    LineProperties.isVisible = clipSidewalk.isVisibleSelf || aligment.isVisibleSelf;
                };
            }
            else if (editObject is MarkupStopLine stopLine)
            {
                var start = AddAlignmentProperty(stopLine.RawStartAlignment, NodeMarkup.Localize.LineEditor_LineStartAlignment);
                var end   = AddAlignmentProperty(stopLine.RawEndAlignment, NodeMarkup.Localize.LineEditor_LineEndAlignment);
                LinePropertiesVisibleAction = () =>
                {
                    start.isVisible          = stopLine.Start.IsSplit;
                    end.isVisible            = stopLine.End.IsSplit;
                    LineProperties.isVisible = start.isVisibleSelf || end.isVisibleSelf;
                };
            }

            SetLinePropertiesVisible();
        }
Exemplo n.º 6
0
 public LineProperties[] GetLineProps()
 {
     LineProperties[] outputArray = new LineProperties[line.Count];
     for (int i = 0; i < outputArray.Length; i++)
     {
         outputArray[i] = line[i]._lineProp;
     }
     return(outputArray);
 }
Exemplo n.º 7
0
    public void CreatePoints(LineProperties lp)
    {
        if (count2 == _step * 3)
        {
            count2 = 0;
        }
        float   _scale = 0.18f;
        Vector3 sp     = Vremap(lp.endPosition);
        Vector3 ep     = Vremap(lp.starPosition);

        if (count2 % _step == 0 | count2 == 0)
        {
            if (count2 != 0)
            {
                Vector3[] temp = new Vector3[lineRenderer.positionCount];
                lineRenderer.GetPositions(temp);
                foreach (var item in temp)
                {
                    Dots(_scale, item);
                }
                stepY -= _step2;
            }

            if (GameObject.Find("lineHolder" + count2) == true)
            {
                Destroy(GameObject.Find("lineHolder" + count2));
            }

            lineHolder   = new GameObject("lineHolder" + count2);
            lineRenderer = lineHolder.AddComponent <LineRenderer>();
            lineHolder.transform.SetParent(this.transform);
            lineRenderer.positionCount = 0;
            lineRenderer.material      = mat;
        }
        if (lp.type == "Arc")
        {
            GameObject _temp = Instantiate(prefabText);
            _temp.transform.SetParent(lineHolder.transform);
            _temp.transform.position = ep + Vector3.down + Vector3.left;
            _temp.GetComponent <TextMeshPro>().text = lp.angle.ToString();
        }
        count2++;

        lineRenderer.positionCount += 1;
        if (lineRenderer.positionCount >= 2)
        {
            lineRenderer.SetPosition(lineRenderer.positionCount - 1, ep);
            lineRenderer.startWidth = _scale / 10;
            lineRenderer.endWidth   = _scale;
        }
        else
        {
            lineRenderer.SetPosition(0, FindObjectOfType <Mover>().transform.position);
        }
    }
Exemplo n.º 8
0
 private void GetBreakpointLineProperties(LineProperties props, int cpuAddress)
 {
     foreach (Breakpoint breakpoint in BreakpointManager.Breakpoints)
     {
         if (breakpoint.Matches((uint)cpuAddress, SnesMemoryType.SpcMemory))
         {
             SetBreakpointLineProperties(props, breakpoint);
             return;
         }
     }
 }
Exemplo n.º 9
0
        public void GetBreakpointLineProperties(LineProperties props, int cpuAddress)
        {
            DebuggerInfo config = ConfigManager.Config.Debug.Debugger;

            foreach (Breakpoint breakpoint in BreakpointManager.Breakpoints)
            {
                if (breakpoint.Matches((uint)cpuAddress, SnesMemoryType.CpuMemory))
                {
                    SetBreakpointLineProperties(props, breakpoint);
                }
            }
        }
Exemplo n.º 10
0
        // Token: 0x06006881 RID: 26753 RVA: 0x001D7B3C File Offset: 0x001D5D3C
        private TextCollapsingProperties GetCollapsingProps(double wrappingWidth, LineProperties paraProperties)
        {
            Invariant.Assert(paraProperties.TextTrimming > TextTrimming.None, "Text trimming must be enabled.");
            TextCollapsingProperties result;

            if (paraProperties.TextTrimming == TextTrimming.CharacterEllipsis)
            {
                result = new TextTrailingCharacterEllipsis(wrappingWidth, paraProperties.DefaultTextRunProperties);
            }
            else
            {
                result = new TextTrailingWordEllipsis(wrappingWidth, paraProperties.DefaultTextRunProperties);
            }
            return(result);
        }
 // Token: 0x06004134 RID: 16692 RVA: 0x0012A210 File Offset: 0x00128410
 internal void Format(int dcp, double formatWidth, double paragraphWidth, LineProperties lineProperties, TextRunCache textRunCache, TextFormatter formatter)
 {
     this._lineProperties = lineProperties;
     this._dcp            = dcp;
     this._paragraphWidth = paragraphWidth;
     lineProperties.IgnoreTextAlignment = (lineProperties.TextAlignment != TextAlignment.Justify);
     try
     {
         this._line = formatter.FormatLine(this, dcp, formatWidth, lineProperties, null, textRunCache);
     }
     finally
     {
         lineProperties.IgnoreTextAlignment = false;
     }
 }
Exemplo n.º 12
0
		// Token: 0x060068A0 RID: 26784 RVA: 0x001D8230 File Offset: 0x001D6430
		internal void FormatAndDrawVisual(DrawingContext ctx, LineProperties lineProps, int ur, int vrBaseline)
		{
			bool flag = lineProps.FlowDirection == FlowDirection.RightToLeft;
			this._host.Context = this;
			try
			{
				TextLine textLine = this._host.TextFormatter.FormatLine(this._host, 0, 0.0, lineProps.FirstLineProps, null, new TextRunCache());
				Point origin = new Point(TextDpi.FromTextDpi(ur), TextDpi.FromTextDpi(vrBaseline) - textLine.Baseline);
				textLine.Draw(ctx, origin, flag ? InvertAxes.Horizontal : InvertAxes.None);
				textLine.Dispose();
			}
			finally
			{
				this._host.Context = null;
			}
		}
Exemplo n.º 13
0
        private void GetBreakpointLineProperties(LineProperties props, int cpuAddress)
        {
            AddressInfo absAddress = DebugApi.GetAbsoluteAddress(new AddressInfo()
            {
                Address = cpuAddress, Type = SnesMemoryType.NecDspMemory
            });

            foreach (Breakpoint breakpoint in BreakpointManager.Breakpoints)
            {
                if (breakpoint.Matches((uint)cpuAddress, SnesMemoryType.NecDspMemory, CpuType.NecDsp) || (absAddress.Address >= 0 && breakpoint.Matches((uint)absAddress.Address, absAddress.Type, CpuType.NecDsp)))
                {
                    SetBreakpointLineProperties(props, breakpoint);
                    return;
                }
            }
        }
Exemplo n.º 14
0
        private void AddLineProperties(MarkupLine editObject)
        {
            LineProperties = ComponentPool.Get <PropertyGroupPanel>(ContentPanel.Content);
            LineProperties.Init();

            if (editObject is MarkupRegularLine line)
            {
                var lineAlignment = ComponentPool.Get <LineAlignmentPropertyPanel>(LineProperties, "LineAlignment");
                lineAlignment.Text = NodeMarkup.Localize.LineEditor_LineAlignment;
                lineAlignment.Init();
                lineAlignment.SelectedObject         = line.RawAlignment;
                lineAlignment.OnSelectObjectChanged += (value) => line.RawAlignment.Value = value;
            }

            SetLinePropertiesVisible();
        }
Exemplo n.º 15
0
        public void GetBreakpointLineProperties(LineProperties props, int cpuAddress)
        {
            DebuggerInfo config     = ConfigManager.Config.Debug.Debugger;
            AddressInfo  absAddress = DebugApi.GetAbsoluteAddress(new AddressInfo()
            {
                Address = cpuAddress, Type = SnesMemoryType.CpuMemory
            });

            foreach (Breakpoint breakpoint in BreakpointManager.Breakpoints)
            {
                if (breakpoint.Matches((uint)cpuAddress, SnesMemoryType.CpuMemory, CpuType.Cpu) || (absAddress.Address >= 0 && breakpoint.Matches((uint)absAddress.Address, absAddress.Type, CpuType.Cpu)))
                {
                    SetBreakpointLineProperties(props, breakpoint);
                }
            }
        }
Exemplo n.º 16
0
        public override LineProperties GetLineStyle(CodeLineData lineData, int lineIndex)
        {
            DebuggerInfo   cfg   = ConfigManager.Config.Debug.Debugger;
            LineProperties props = new LineProperties();

            if (lineData.Address >= 0)
            {
                GetBreakpointLineProperties(props, lineData.Address);
            }

            bool isActiveStatement = ActiveAddress.HasValue && ActiveAddress.Value == lineData.Address;

            if (isActiveStatement)
            {
                ConfigureActiveStatement(props);
            }

            //TODO

            /* else if(_code._code.UnexecutedAddresses.Contains(lineNumber)) {
             *      props.LineBgColor = info.CodeUnexecutedCodeColor;
             * }*/

            if (lineData.Flags.HasFlag(LineFlags.PrgRom))
            {
                props.AddressColor = Color.Gray;
            }
            else if (lineData.Flags.HasFlag(LineFlags.WorkRam))
            {
                props.AddressColor = Color.DarkBlue;
            }
            else if (lineData.Flags.HasFlag(LineFlags.SaveRam))
            {
                props.AddressColor = Color.DarkRed;
            }

            if (lineData.Flags.HasFlag(LineFlags.VerifiedData))
            {
                props.LineBgColor = cfg.CodeVerifiedDataColor;
            }
            else if (!lineData.Flags.HasFlag(LineFlags.VerifiedCode))
            {
                props.LineBgColor = cfg.CodeUnidentifiedDataColor;
            }

            return(props);
        }
Exemplo n.º 17
0
        //-------------------------------------------------------------------
        //
        //  Internal Methods
        //
        //-------------------------------------------------------------------

        #region Internal Methods

        /// <summary>
        /// Create and format text line.
        /// </summary>
        /// <param name="dcp">First character position for the line.</param>
        /// <param name="formatWidth">Width to pass to LS formatter.</param>
        /// <param name="paragraphWidth">Line wrapping width.</param>
        /// <param name="lineProperties">Line's properties.</param>
        /// <param name="textRunCache">Run cache.</param>
        /// <param name="formatter">Text formatter.</param>
        /// <remarks>
        /// formatWidth/paragraphWidth is an attempt to work around bug 114719.
        /// Unfortunately, Line Services cannot guarantee that once a line
        /// has been measured, measuring the same content with the actual line
        /// width will produce the same line.
        ///
        /// For example, suppose we format dcp 0 with paragraphWidth = 100.
        /// Suppose this results in a line from dcp 0 - 10, with width = 95.
        ///
        /// We would expect that a call to FormatLine with dcp = 0,
        /// paragraphWidth = 95 would result in the same 10 char line.
        /// But in practice it might return a 9 char line.
        ///
        /// The workaround is to pass in an explicit formatting width across
        /// multiple calls, even if the paragraphWidth changes.
        /// </remarks>
        internal void Format(int dcp, double formatWidth, double paragraphWidth, LineProperties lineProperties, TextRunCache textRunCache, TextFormatter formatter)
        {
            _lineProperties = lineProperties;
            _dcp            = dcp;
            _paragraphWidth = paragraphWidth;

            // We must ignore TextAlignment here since formatWidth does not
            // necessarilly equal paragraphWidth.  We'll adjust on later calls.
            lineProperties.IgnoreTextAlignment = (lineProperties.TextAlignment != TextAlignment.Justify);
            try
            {
                _line = formatter.FormatLine(this, dcp, formatWidth, lineProperties, null, textRunCache);
            }
            finally
            {
                lineProperties.IgnoreTextAlignment = false;
            }
        }
Exemplo n.º 18
0
        public override LineProperties GetLineStyle(CodeLineData lineData, int lineIndex)
        {
            DebuggerInfo   cfg   = ConfigManager.Config.Debug.Debugger;
            LineProperties props = new LineProperties();

            if (lineData.Address >= 0)
            {
                GetBreakpointLineProperties(props, lineData.Address);
            }

            bool isActiveStatement = ActiveAddress.HasValue && ActiveAddress.Value == lineData.Address;

            if (isActiveStatement)
            {
                ConfigureActiveStatement(props);
            }

            return(props);
        }
Exemplo n.º 19
0
            public LineProperties GetLineStyle(int cpuAddress, int lineIndex)
            {
                DebugInfo      info  = ConfigManager.Config.DebugInfo;
                LineProperties props = new LineProperties();

                int nextLineIndex = lineIndex + 1;
                int nextCpuAddress;

                do
                {
                    nextCpuAddress = _viewer.CodeViewer.GetLineNumber(nextLineIndex);
                    nextLineIndex++;
                } while(nextCpuAddress < 0);

                bool isActiveStatement = (
                    cpuAddress >= 0 &&
                    _viewer._currentActiveAddress.HasValue && (
                        (_viewer._currentActiveAddress >= cpuAddress && _viewer._currentActiveAddress <nextCpuAddress && nextCpuAddress> cpuAddress) ||
                        (_viewer._currentActiveAddress == cpuAddress && nextCpuAddress < cpuAddress)
                        )
                    );

                int prgAddress = _viewer._symbolProvider.GetPrgAddress(_viewer.CurrentFile.ID, lineIndex);

                if (prgAddress >= 0)
                {
                    AddressTypeInfo addressInfo = new AddressTypeInfo();
                    addressInfo.Address = prgAddress;
                    addressInfo.Type    = AddressType.PrgRom;

                    ctrlDebuggerCode.LineStyleProvider.GetBreakpointLineProperties(props, cpuAddress, addressInfo);
                }

                if (isActiveStatement)
                {
                    props.FgColor     = Color.Black;
                    props.TextBgColor = info.CodeActiveStatementColor;
                    props.Symbol     |= LineSymbol.Arrow;
                }

                return(props);
            }
Exemplo n.º 20
0
        private UIElement CreateLineControlBorder(LineProperties prop)
        {
            Border border = new Border()
            {
                CornerRadius = new CornerRadius(5),
                //Name = prop.LinenName,
                Width      = double.NaN,
                Height     = double.NaN,
                Margin     = new Thickness(0, 0, 5, 0),
                Background = new SolidColorBrush(prop.LineColor)
            };

            border.Child = new Label()
            {
                Content    = prop.LinenName,
                Foreground = new SolidColorBrush(prop.TextColor),
            };

            return(border);
        }
Exemplo n.º 21
0
            public LineProperties GetLineStyle(int cpuAddress, int lineIndex)
            {
                LineProperties props = new LineProperties();

                int nextLineIndex = lineIndex + 1;
                int nextCpuAddress;

                do
                {
                    nextCpuAddress = _viewer.CodeViewer.GetLineNumber(nextLineIndex);
                    nextLineIndex++;
                } while(nextCpuAddress < 0);

                bool isActiveStatement = (
                    cpuAddress >= 0 &&
                    _viewer._currentActiveAddress.HasValue && (
                        (_viewer._currentActiveAddress >= cpuAddress && _viewer._currentActiveAddress <nextCpuAddress && nextCpuAddress> cpuAddress) ||
                        (_viewer._currentActiveAddress == cpuAddress && nextCpuAddress < cpuAddress)
                        )
                    );

                int prgAddress = _viewer._symbolProvider?.GetPrgAddress(_viewer.CurrentFile.ID, lineIndex) ?? -1;

                if (prgAddress >= 0)
                {
                    AddressTypeInfo addressInfo = new AddressTypeInfo();
                    addressInfo.Address = prgAddress;
                    addressInfo.Type    = AddressType.PrgRom;

                    ctrlDebuggerCode.LineStyleProvider.GetBreakpointLineProperties(props, cpuAddress, addressInfo);
                }

                if (isActiveStatement)
                {
                    ctrlDebuggerCode.LineStyleProvider.ConfigureActiveStatement(props);
                }

                return(props);
            }
Exemplo n.º 22
0
        /// <summary>
        /// Create and format text line.
        /// </summary>
        /// <param name="ctx">
        /// DrawingContext for text line.
        /// </param>
        /// <param name="lineProps">
        /// LineProperties of text line
        /// </param>
        /// <param name="ur">
        /// Horizontal draw location
        /// </param>
        /// <param name="vrBaseline">
        /// Vertical baseline draw location
        /// </param>
        internal void FormatAndDrawVisual(DrawingContext ctx, LineProperties lineProps, int ur, int vrBaseline)
        {
            System.Windows.Media.TextFormatting.TextLine line;
            bool mirror = (lineProps.FlowDirection == FlowDirection.RightToLeft);

            _host.Context = this;

            try
            {
                // Create line object
                line = _host.TextFormatter.FormatLine(_host, 0, 0, lineProps.FirstLineProps, null, new TextRunCache());

                Point drawLocation = new Point(TextDpi.FromTextDpi(ur), TextDpi.FromTextDpi(vrBaseline) - line.Baseline);

                line.Draw(ctx, drawLocation, (mirror ? InvertAxes.Horizontal : InvertAxes.None));
                line.Dispose();
            }
            finally
            {
                // clear the context
                _host.Context = null;
            }
        }
Exemplo n.º 23
0
 public static void ConfigureActiveStatement(LineProperties props)
 {
     props.FgColor     = Color.Black;
     props.TextBgColor = ConfigManager.Config.Debug.Debugger.CodeActiveStatementColor;
     props.Symbol     |= LineSymbol.Arrow;
 }
Exemplo n.º 24
0
    void FixedUpdate()
    {
        if (targe != Vector3.zero)
        {
            Transform myTransform = this.transform;
            if (restart)
            {
                lineProperties        = new LineProperties();
                lineProperties.LR     = OrientationOfTarget(myTransform.forward, targe, myTransform.up);
                lineProperties.center = CalculateCenter(targe, lineProperties.LR);
                restart = false;
            }
            int angle = (int)FindAngle(lineProperties.center.position, myTransform.position, targe);
            //Debug.Log(angle +" Center  "+ lineProperties.center.position+"  ourPosition  "+ myTransform.position +"  the target "+ targe);

            //////////////////////////////////---------------------------------->>>>>>> If object is not in front rotate around a point towords the trget
            if (Mathf.Abs(angle - 90) > Mathf.Epsilon && !ontarget)
            {
                if (lineProperties.LR == 1 || lineProperties.LR == -1)
                {
                    if (firstTime)
                    {
                        lineProperties.type         = "Arc";
                        lineProperties.angle        = angle;
                        lineProperties.starPosition = transform.position;
                        firstTime = false;
                    }
                    transform.RotateAround(lineProperties.center.position, Vector3.back, lineProperties.LR * rottationSpeed * Time.deltaTime);
                }
            }
            else
            {
                //////////////////////////////////---------------------------------->>>>>>> Else if object is in front go towords object
                ontarget = true;
                if (myTransform.position != targe)
                {
                    if (!firstTime)
                    {
                        lineProperties.endPosition = transform.position;
                        FindObjectOfType <ControlSystem>().SetLine = lineProperties;
                        lineProperties.type         = "Line";
                        lineProperties.starPosition = transform.position;
                        firstTime = true;
                    }

                    float step = rottationSpeed / 5 * Time.deltaTime;
                    transform.position = Vector3.MoveTowards(transform.position, targe, step);
                }
                else
                {
                    lineProperties.endPosition = transform.position;
                    FindObjectOfType <ControlSystem>().SetLine = lineProperties;
                    targe    = FindObjectOfType <ControlSystem>().GetTarget;
                    ontarget = false;
                    restart  = true;
                }
            }
            if (angle < -181 | angle > 181)
            {
                restart = true;
                targe   = Vector3.zero;
                return;
            }
        }
        else
        {
            targe = FindObjectOfType <ControlSystem>().GetOld;
        }
    }
Exemplo n.º 25
0
        public static void AddLine(
            ref VertexHelper vh,
            LineProperties lineProperties,
            PointsList.PointListProperties pointListProperties,
            Vector2 positionOffset,
            GeoUtils.OutlineProperties outlineProperties,
            Color32 color,
            Vector2 uv,
            ref PointsList.PointsData pointsData,
            GeoUtils.EdgeGradientData edgeGradientData
            )
        {
            pointListProperties.SetPoints();
            pointsData.IsClosed = lineProperties.Closed && pointListProperties.Positions.Length > 2;

            pointsData.GenerateRoundedCaps = lineProperties.LineCap == LineProperties.LineCapTypes.Round;

            pointsData.LineWeight = outlineProperties.LineWeight;

            if (pointsData.GenerateRoundedCaps)
            {
                lineProperties.RoundedCapResolution.UpdateAdjusted(outlineProperties.HalfLineWeight, 0.0f, 2.0f);
                pointsData.RoundedCapResolution = lineProperties.RoundedCapResolution.AdjustedResolution;
            }

            if (!PointsList.SetLineData(pointListProperties, ref pointsData))
            {
                return;
            }


            // scale uv x for caps
            float uvXMin    = 0.0f;
            float uvXLength = 1.0f;

            if (
                !lineProperties.Closed &&
                lineProperties.LineCap != LineProperties.LineCapTypes.Close
                )
            {
                float uvStartOffset = outlineProperties.LineWeight / pointsData.TotalLength;

                uvXMin    = uvStartOffset * 0.5f;
                uvXLength = 1.0f - uvXMin * 2.0f;
            }

            float innerOffset = outlineProperties.GetCenterDistace() - (outlineProperties.HalfLineWeight + edgeGradientData.ShadowOffset) * edgeGradientData.InnerScale;
            float outerOffset = outlineProperties.GetCenterDistace() + (outlineProperties.HalfLineWeight + edgeGradientData.ShadowOffset) * edgeGradientData.InnerScale;

            float capOffsetAmount = 0.0f;

            if (!lineProperties.Closed && lineProperties.LineCap == LineProperties.LineCapTypes.Close)
            {
                capOffsetAmount = edgeGradientData.ShadowOffset * (edgeGradientData.InnerScale * 2.0f - 1.0f);
            }


            int numVertices = vh.currentVertCount;
            int startVertex = numVertices - 1;
            int baseIndex;

            uv.x = uvXMin + pointsData.NormalizedPositionDistances[0] * uvXLength;
            uv.y = 0.0f;

            {
                tmpPos.x = positionOffset.x + pointsData.Positions[0].x + pointsData.PositionNormals[0].x * innerOffset + pointsData.StartCapOffset.x * capOffsetAmount;
                tmpPos.y = positionOffset.y + pointsData.Positions[0].y + pointsData.PositionNormals[0].y * innerOffset + pointsData.StartCapOffset.y * capOffsetAmount;
            }

            vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

            uv.y = 1.0f;

            {
                tmpPos.x = positionOffset.x + pointsData.Positions[0].x + pointsData.PositionNormals[0].x * outerOffset + pointsData.StartCapOffset.x * capOffsetAmount;
                tmpPos.y = positionOffset.y + pointsData.Positions[0].y + pointsData.PositionNormals[0].y * outerOffset + pointsData.StartCapOffset.y * capOffsetAmount;
            }

            vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

            for (int i = 1; i < pointsData.NumPositions - 1; i++)
            {
                uv.x = uvXMin + pointsData.NormalizedPositionDistances[i] * uvXLength;
                uv.y = 0.0f;

                {
                    tmpPos.x = positionOffset.x + pointsData.Positions[i].x + pointsData.PositionNormals[i].x * innerOffset;
                    tmpPos.y = positionOffset.y + pointsData.Positions[i].y + pointsData.PositionNormals[i].y * innerOffset;
                }

                vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                uv.y = 1.0f;

                {
                    tmpPos.x = positionOffset.x + pointsData.Positions[i].x + pointsData.PositionNormals[i].x * outerOffset;
                    tmpPos.y = positionOffset.y + pointsData.Positions[i].y + pointsData.PositionNormals[i].y * outerOffset;
                }

                vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                baseIndex = startVertex + i * 2;
                vh.AddTriangle(baseIndex - 1, baseIndex, baseIndex + 1);
                vh.AddTriangle(baseIndex, baseIndex + 2, baseIndex + 1);
            }

            // add end vertices
            int endIndex = pointsData.NumPositions - 1;

            uv.x = uvXMin + pointsData.NormalizedPositionDistances[endIndex] * uvXLength;
            uv.y = 0.0f;

            {
                tmpPos.x = positionOffset.x + pointsData.Positions[endIndex].x + pointsData.PositionNormals[endIndex].x * innerOffset + pointsData.EndCapOffset.x * capOffsetAmount;
                tmpPos.y = positionOffset.y + pointsData.Positions[endIndex].y + pointsData.PositionNormals[endIndex].y * innerOffset + pointsData.EndCapOffset.y * capOffsetAmount;
            }

            vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

            uv.y = 1.0f;

            {
                tmpPos.x = positionOffset.x + pointsData.Positions[endIndex].x + pointsData.PositionNormals[endIndex].x * outerOffset + pointsData.EndCapOffset.x * capOffsetAmount;
                tmpPos.y = positionOffset.y + pointsData.Positions[endIndex].y + pointsData.PositionNormals[endIndex].y * outerOffset + pointsData.EndCapOffset.y * capOffsetAmount;
            }

            vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

            baseIndex = startVertex + endIndex * 2;
            vh.AddTriangle(baseIndex - 1, baseIndex, baseIndex + 1);
            vh.AddTriangle(baseIndex, baseIndex + 2, baseIndex + 1);

            if (lineProperties.Closed)
            {
                uv.x = 1.0f;
                uv.y = 0.0f;

                {
                    tmpPos.x = positionOffset.x + pointsData.Positions[0].x + pointsData.PositionNormals[0].x * innerOffset + pointsData.StartCapOffset.x * capOffsetAmount;
                    tmpPos.y = positionOffset.y + pointsData.Positions[0].y + pointsData.PositionNormals[0].y * innerOffset + pointsData.StartCapOffset.y * capOffsetAmount;
                }

                vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                uv.y = 1.0f;

                {
                    tmpPos.x = positionOffset.x + pointsData.Positions[0].x + pointsData.PositionNormals[0].x * outerOffset + pointsData.StartCapOffset.x * capOffsetAmount;
                    tmpPos.y = positionOffset.y + pointsData.Positions[0].y + pointsData.PositionNormals[0].y * outerOffset + pointsData.StartCapOffset.y * capOffsetAmount;
                }

                vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                baseIndex = startVertex + endIndex * 2 + 2;
                vh.AddTriangle(baseIndex - 1, baseIndex, baseIndex + 1);
                vh.AddTriangle(baseIndex, baseIndex + 2, baseIndex + 1);
            }

            if (edgeGradientData.IsActive)
            {
                byte colorAlpha = color.a;

                innerOffset = outlineProperties.GetCenterDistace() - (outlineProperties.HalfLineWeight + edgeGradientData.ShadowOffset);
                outerOffset = outlineProperties.GetCenterDistace() + (outlineProperties.HalfLineWeight + edgeGradientData.ShadowOffset);

                innerOffset -= edgeGradientData.SizeAdd;
                outerOffset += edgeGradientData.SizeAdd;

                color.a = 0;

                int outerBaseIndex = numVertices + pointsData.NumPositions * 2;

                if (lineProperties.Closed)
                {
                    outerBaseIndex += 2;
                }

                uv.x = uvXMin + pointsData.NormalizedPositionDistances[0] * uvXLength;
                uv.y = 0.0f;

                {
                    tmpPos.x = positionOffset.x + pointsData.Positions[0].x + pointsData.PositionNormals[0].x * innerOffset;
                    tmpPos.y = positionOffset.y + pointsData.Positions[0].y + pointsData.PositionNormals[0].y * innerOffset;
                }

                vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                uv.y = 1.0f;

                {
                    tmpPos.x = positionOffset.x + pointsData.Positions[0].x + pointsData.PositionNormals[0].x * outerOffset;
                    tmpPos.y = positionOffset.y + pointsData.Positions[0].y + pointsData.PositionNormals[0].y * outerOffset;
                }

                vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                for (int i = 1; i < pointsData.NumPositions; i++)
                {
                    uv.x = uvXMin + pointsData.NormalizedPositionDistances[i] * uvXLength;
                    uv.y = 0.0f;

                    {
                        tmpPos.x = positionOffset.x + pointsData.Positions[i].x + pointsData.PositionNormals[i].x * innerOffset;
                        tmpPos.y = positionOffset.y + pointsData.Positions[i].y + pointsData.PositionNormals[i].y * innerOffset;
                    }

                    vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                    uv.y = 1.0f;

                    {
                        tmpPos.x = positionOffset.x + pointsData.Positions[i].x + pointsData.PositionNormals[i].x * outerOffset;
                        tmpPos.y = positionOffset.y + pointsData.Positions[i].y + pointsData.PositionNormals[i].y * outerOffset;
                    }

                    vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                    // inner quad
                    vh.AddTriangle(startVertex + i * 2 - 1, startVertex + i * 2 + 1, outerBaseIndex + i * 2);
                    vh.AddTriangle(startVertex + i * 2 - 1, outerBaseIndex + i * 2, outerBaseIndex + i * 2 - 2);

                    // outer quad
                    vh.AddTriangle(startVertex + i * 2, outerBaseIndex + i * 2 - 1, startVertex + i * 2 + 2);
                    vh.AddTriangle(startVertex + i * 2 + 2, outerBaseIndex + i * 2 - 1, outerBaseIndex + i * 2 + 1);
                }

                if (lineProperties.Closed)
                {
                    int lastIndex = pointsData.NumPositions;

                    uv.x = 1.0f;
                    uv.y = 0.0f;

                    {
                        tmpPos.x = positionOffset.x + pointsData.Positions[0].x + pointsData.PositionNormals[0].x * innerOffset;
                        tmpPos.y = positionOffset.y + pointsData.Positions[0].y + pointsData.PositionNormals[0].y * innerOffset;
                    }

                    vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                    uv.y = 1.0f;

                    {
                        tmpPos.x = positionOffset.x + pointsData.Positions[0].x + pointsData.PositionNormals[0].x * outerOffset;
                        tmpPos.y = positionOffset.y + pointsData.Positions[0].y + pointsData.PositionNormals[0].y * outerOffset;
                    }

                    vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                    // inner quad
                    vh.AddTriangle(startVertex + lastIndex * 2 - 1, startVertex + lastIndex * 2 + 1, outerBaseIndex + lastIndex * 2);
                    vh.AddTriangle(startVertex + lastIndex * 2 - 1, outerBaseIndex + lastIndex * 2, outerBaseIndex + lastIndex * 2 - 2);

                    // outer quad
                    vh.AddTriangle(startVertex + lastIndex * 2, outerBaseIndex + lastIndex * 2 - 1, startVertex + lastIndex * 2 + 2);
                    vh.AddTriangle(startVertex + lastIndex * 2 + 2, outerBaseIndex + lastIndex * 2 - 1, outerBaseIndex + lastIndex * 2 + 1);
                }

                color.a = colorAlpha;
            }

            // close line or add caps
            if (!lineProperties.Closed)
            {
                AddStartCap(
                    ref vh,
                    lineProperties,
                    positionOffset,
                    outlineProperties,
                    color,
                    uv,
                    uvXMin,
                    uvXLength,
                    pointsData,
                    edgeGradientData
                    );

                AddEndCap(
                    ref vh,
                    lineProperties,
                    positionOffset,
                    outlineProperties,
                    color,
                    uv,
                    uvXMin,
                    uvXLength,
                    pointsData,
                    edgeGradientData
                    );
            }
        }
Exemplo n.º 26
0
 public LineGlyph(LineProperties properties)
 {
     m_properties = properties;
 }
Exemplo n.º 27
0
 public LineGlyph()
 {
     m_properties = new LineProperties();
 }
Exemplo n.º 28
0
        public static void AddEndCap(
            ref VertexHelper vh,
            LineProperties lineProperties,
            Vector2 positionOffset,
            GeoUtils.OutlineProperties outlineProperties,
            Color32 color,
            Vector2 uv,
            float uvXMin,
            float uvXLength,
            PointsList.PointsData pointsData,
            GeoUtils.EdgeGradientData edgeGradientData
            )
        {
            int currentVertCount = vh.currentVertCount;
            int startIndex       = currentVertCount;

            if (edgeGradientData.IsActive)
            {
                startIndex -= pointsData.NumPositions * 2;
            }

            int lastPositionIndex = pointsData.NumPositions - 1;

            tmpPos2.x = positionOffset.x + pointsData.Positions[lastPositionIndex].x;
            tmpPos2.y = positionOffset.y + pointsData.Positions[lastPositionIndex].y;

            switch (lineProperties.LineCap)
            {
            case LineProperties.LineCapTypes.Close:

                startIndex -= 4;

                AddCloseCap(
                    ref vh,
                    false,
                    startIndex,
                    tmpPos2,
                    pointsData.PositionNormals[lastPositionIndex],
                    pointsData.EndCapOffset,
                    1,
                    lineProperties,
                    outlineProperties,
                    color,
                    uv,
                    pointsData,
                    edgeGradientData,
                    currentVertCount
                    );

                break;

            case LineProperties.LineCapTypes.Projected:

                startIndex -= 6;

                AddProjectedCap(
                    ref vh,
                    false,
                    startIndex,
                    tmpPos2,
                    pointsData.PositionNormals[lastPositionIndex],
                    pointsData.EndCapOffset,
                    1,
                    lineProperties,
                    outlineProperties,
                    color,
                    uv,
                    pointsData,
                    edgeGradientData,
                    currentVertCount
                    );

                break;

            case LineProperties.LineCapTypes.Round:
#if CENTER_ROUNDED_CAPS
                startIndex -= pointsData.RoundedCapResolution + 3;
#else
                startIndex -= pointsData.RoundedCapResolution + 2;
#endif

                if (edgeGradientData.IsActive)
                {
                    startIndex -= pointsData.RoundedCapResolution;
                }

                AddRoundedCap(
                    ref vh,
                    false,
                    startIndex,
                    tmpPos2,
                    pointsData.PositionNormals[lastPositionIndex],
                    pointsData.EndCapOffset,
                    1,
                    lineProperties,
                    outlineProperties,
                    color,
                    uv,
                    pointsData,
                    edgeGradientData,
                    pointsData.EndCapOffsets,
                    pointsData.EndCapUVs,
                    uvXMin,
                    uvXLength,
                    currentVertCount
                    );

                break;
            }
        }
Exemplo n.º 29
0
        public static void AddProjectedCap(
            ref VertexHelper vh,
            bool isStart,
            int firstVertIndex,
            Vector2 position,
            Vector2 normal,
            Vector2 capOffset,
            int invertIndices,
            LineProperties lineProperties,
            GeoUtils.OutlineProperties outlineProperties,
            Color32 color,
            Vector2 uv,
            PointsList.PointsData pointsData,
            GeoUtils.EdgeGradientData edgeGradientData,
            int currentVertCount
            )
        {
            int baseIndex = currentVertCount;

            if (isStart)
            {
                uv.x = 0.0f;
            }
            else
            {
                uv.x = 1.0f;
            }

            float innerOffset = outlineProperties.GetCenterDistace() - (outlineProperties.HalfLineWeight + edgeGradientData.ShadowOffset) * edgeGradientData.InnerScale;
            float outerOffset = outlineProperties.GetCenterDistace() + (outlineProperties.HalfLineWeight + edgeGradientData.ShadowOffset) * edgeGradientData.InnerScale;

            float capOffsetAmount = edgeGradientData.ShadowOffset + outlineProperties.LineWeight * 0.5f;

            capOffsetAmount *= edgeGradientData.InnerScale;

            // add lineWeight to position
            {
                tmpPos.x = position.x + normal.x * innerOffset + capOffset.x * capOffsetAmount;
                tmpPos.y = position.y + normal.y * innerOffset + capOffset.y * capOffsetAmount;
            }

            uv.y = 0.0f;
            vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

            {
                tmpPos.x = position.x + normal.x * outerOffset + capOffset.x * capOffsetAmount;
                tmpPos.y = position.y + normal.y * outerOffset + capOffset.y * capOffsetAmount;
            }

            uv.y = 1.0f;
            vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

            vh.AddTriangle(firstVertIndex, baseIndex + invertIndices, baseIndex + 1 - invertIndices);
            vh.AddTriangle(firstVertIndex + invertIndices, baseIndex + 1, firstVertIndex + 1 - invertIndices);

            if (edgeGradientData.IsActive)
            {
                innerOffset = outlineProperties.GetCenterDistace() - (outlineProperties.HalfLineWeight + edgeGradientData.ShadowOffset) - edgeGradientData.SizeAdd;
                outerOffset = outlineProperties.GetCenterDistace() + (outlineProperties.HalfLineWeight + edgeGradientData.ShadowOffset) + edgeGradientData.SizeAdd;

                capOffsetAmount = outlineProperties.HalfLineWeight + edgeGradientData.SizeAdd + edgeGradientData.ShadowOffset;

                color.a = 0;

                {
                    tmpPos.x = position.x + normal.x * innerOffset + capOffset.x * capOffsetAmount;
                    tmpPos.y = position.y + normal.y * innerOffset + capOffset.y * capOffsetAmount;
                }

                uv.y = 0.0f;
                vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);


                {
                    tmpPos.x = position.x + normal.x * outerOffset + capOffset.x * capOffsetAmount;
                    tmpPos.y = position.y + normal.y * outerOffset + capOffset.y * capOffsetAmount;
                }

                uv.y = 1.0f;
                vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                int antiAliasedIndex = firstVertIndex + pointsData.NumPositions * 2;
                baseIndex += 2;

                if (invertIndices != 0)
                {
                    vh.AddTriangle(firstVertIndex, baseIndex, antiAliasedIndex);
                    vh.AddTriangle(firstVertIndex + 1, antiAliasedIndex + 1, baseIndex + 1);

                    vh.AddTriangle(baseIndex - 2, baseIndex - 1, baseIndex);
                    vh.AddTriangle(baseIndex + 1, baseIndex, baseIndex - 1);

                    vh.AddTriangle(firstVertIndex, baseIndex - 2, baseIndex);
                    vh.AddTriangle(firstVertIndex + 1, baseIndex + 1, baseIndex - 1);
                }
                else
                {
                    vh.AddTriangle(firstVertIndex, antiAliasedIndex, baseIndex);
                    vh.AddTriangle(firstVertIndex + 1, baseIndex + 1, antiAliasedIndex + 1);

                    vh.AddTriangle(baseIndex - 2, baseIndex, baseIndex - 1);
                    vh.AddTriangle(baseIndex + 1, baseIndex - 1, baseIndex);

                    vh.AddTriangle(firstVertIndex, baseIndex, baseIndex - 2);
                    vh.AddTriangle(firstVertIndex + 1, baseIndex - 1, baseIndex + 1);
                }
            }
        }
Exemplo n.º 30
0
        public static void AddRoundedCap(
            ref VertexHelper vh,
            bool isStart,
            int firstVertIndex,
            Vector2 position,
            Vector2 normal,
            Vector2 capOffset,
            int invertIndices,
            LineProperties lineProperties,
            GeoUtils.OutlineProperties outlineProperties,
            Color32 color,
            Vector2 uv,
            PointsList.PointsData pointsData,
            GeoUtils.EdgeGradientData edgeGradientData,
            Vector2[] capOffsets,
            Vector2[] uvOffsets,
            float uvXMin,
            float uvXLength,
            int currentVertCount
            )
        {
            int baseIndex = currentVertCount;

            float innerOffset     = outlineProperties.GetCenterDistace();
            float capOffsetAmount = (edgeGradientData.ShadowOffset + outlineProperties.HalfLineWeight) * edgeGradientData.InnerScale;

            if (isStart)
            {
                uv.x = uvXMin;
            }
            else
            {
                uv.x = uvXMin + uvXLength;
            }

#if CENTER_ROUNDED_CAPS
            // add center vert
            tmpPos.x = position.x;
            tmpPos.y = position.y;
            uv.y     = 0.5f;

            vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);
#endif

            for (int i = 0; i < capOffsets.Length; i++)
            {
                {
                    tmpPos.x = position.x + normal.x * innerOffset + capOffsets[i].x * capOffsetAmount;
                    tmpPos.y = position.y + normal.y * innerOffset + capOffsets[i].y * capOffsetAmount;
                }

                if (isStart)
                {
                    uv.x = Mathf.LerpUnclamped(uvXMin, 0.0f, uvOffsets[i].x);
                }
                else
                {
                    uv.x = Mathf.LerpUnclamped(uvXMin + uvXLength, 1.0f, uvOffsets[i].x);
                }
                uv.y = uvOffsets[i].y;

                vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                if (i > 0)
                {
#if CENTER_ROUNDED_CAPS
                    vh.AddTriangle(baseIndex, baseIndex + i - 1, baseIndex + i);
#else
                    vh.AddTriangle(firstVertIndex, baseIndex + i - 1, baseIndex + i);
#endif
                }
            }

            // last fans
            if (isStart)
            {
#if CENTER_ROUNDED_CAPS
                // starting triangle
                vh.AddTriangle(baseIndex + 1, baseIndex, firstVertIndex);

                // end triangles
                vh.AddTriangle(baseIndex, baseIndex + capOffsets.Length - 1, baseIndex + capOffsets.Length);
                vh.AddTriangle(baseIndex, baseIndex + capOffsets.Length, firstVertIndex + 1);
#else
                vh.AddTriangle(baseIndex + capOffsets.Length - 1, firstVertIndex + 1, firstVertIndex);
#endif
            }
            else
            {
#if CENTER_ROUNDED_CAPS
                // starting triangle
                vh.AddTriangle(baseIndex + 1, baseIndex, firstVertIndex + 1);

                // end triangles
                vh.AddTriangle(baseIndex, baseIndex + capOffsets.Length - 1, baseIndex + capOffsets.Length);
                vh.AddTriangle(baseIndex, baseIndex + capOffsets.Length, firstVertIndex);
#else
                vh.AddTriangle(baseIndex, firstVertIndex, firstVertIndex + 1);
#endif
            }

            if (edgeGradientData.IsActive)
            {
                color.a = 0;

                innerOffset = outlineProperties.GetCenterDistace();

                capOffsetAmount = outlineProperties.HalfLineWeight + edgeGradientData.SizeAdd + edgeGradientData.ShadowOffset;

                int antiAliasedIndex = firstVertIndex + pointsData.NumPositions * 2;

                for (int i = 0; i < capOffsets.Length; i++)
                {
                    {
                        tmpPos.x = position.x + normal.x * innerOffset + capOffsets[i].x * capOffsetAmount;
                        tmpPos.y = position.y + normal.y * innerOffset + capOffsets[i].y * capOffsetAmount;
                    }

                    if (isStart)
                    {
                        uv.x = Mathf.LerpUnclamped(uvXMin, 0.0f, uvOffsets[i].x);
                    }
                    else
                    {
                        uv.x = Mathf.LerpUnclamped(uvXMin + uvXLength, 1.0f, uvOffsets[i].x);
                    }
                    uv.y = uvOffsets[i].y;

                    vh.AddVert(tmpPos, color, uv, GeoUtils.ZeroV2, GeoUtils.UINormal, GeoUtils.UITangent);

                    if (i > 0)
                    {
                        vh.AddTriangle(baseIndex + i - 1, baseIndex + capOffsets.Length + i - 1, baseIndex + i);
                        vh.AddTriangle(baseIndex + capOffsets.Length + i, baseIndex + i, baseIndex + capOffsets.Length + i - 1);
                    }
                }

                if (!isStart)
                {
                    vh.AddTriangle(baseIndex, firstVertIndex + 1, antiAliasedIndex + 1);
                    vh.AddTriangle(antiAliasedIndex + 1, baseIndex + capOffsets.Length, baseIndex);

                    vh.AddTriangle(baseIndex + capOffsets.Length * 2 - 1, antiAliasedIndex, firstVertIndex);
                    vh.AddTriangle(baseIndex + capOffsets.Length - 1, baseIndex + capOffsets.Length * 2 - 1, firstVertIndex);
                }
                else
                {
                    vh.AddTriangle(firstVertIndex + 1, baseIndex + capOffsets.Length - 1, baseIndex + capOffsets.Length * 2 - 1);
                    vh.AddTriangle(antiAliasedIndex + 1, firstVertIndex + 1, baseIndex + capOffsets.Length * 2 - 1);

                    vh.AddTriangle(antiAliasedIndex, baseIndex, firstVertIndex);
                    vh.AddTriangle(baseIndex + capOffsets.Length, baseIndex, antiAliasedIndex);
                }
            }
        }