Ejemplo n.º 1
0
        private void DrawRoundCap(VertexHelper vh, Serie serie, Vector3 centerPos, Color color,
                                  float insideRadius, float outsideRadius, ref float drawStartDegree, ref float drawEndDegree)
        {
            if (serie.roundCap && insideRadius > 0 && drawStartDegree != drawEndDegree)
            {
                var width  = (outsideRadius - insideRadius) / 2;
                var radius = insideRadius + width;

                var diffDegree = Mathf.Asin(width / radius) * Mathf.Rad2Deg;
                drawStartDegree += serie.clockwise ? diffDegree : -diffDegree;
                drawEndDegree   -= serie.clockwise ? diffDegree : -diffDegree;
                ChartDrawer.DrawRoundCap(vh, centerPos, width, radius, drawStartDegree, serie.clockwise, color, false);
                ChartDrawer.DrawRoundCap(vh, centerPos, width, radius, drawEndDegree, serie.clockwise, color, true);
            }
        }
Ejemplo n.º 2
0
        private void DrawRoundCap(VertexHelper vh, Serie serie, SerieData serieData, Vector3 centerPos,
                                  Color color, ref float drawStartDegree, ref float drawEndDegree)
        {
            if (serie.roundCap && serieData.runtimePieInsideRadius > 0)
            {
                var width      = (serieData.runtimePieOutsideRadius - serieData.runtimePieInsideRadius) / 2;
                var radius     = serieData.runtimePieInsideRadius + width;
                var diffDegree = Mathf.Asin(width / radius) * Mathf.Rad2Deg;
                drawStartDegree += diffDegree;
                drawEndDegree   -= diffDegree;

                ChartDrawer.DrawRoundCap(vh, centerPos, width, radius, drawStartDegree, serie.clockwise, color, false);
                ChartDrawer.DrawRoundCap(vh, centerPos, width, radius, drawEndDegree, serie.clockwise, color, true);
            }
        }