コード例 #1
0
        private void InternalDrawBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
        {
            int n = Clipper.ClipBezier(x1, y1, x2, y2, x3, y3, x4, y4, clipbuffer, clipMinX, clipMinY, clipMaxX, clipMaxY);
            int penx = 0, peny = 0;

            for (int l = 0; l < n; l += 2)
            {
                GeomUtil.FlattenBezier(x1, y1, x2, y2, x3, y3, x4, y4, true, flattentol, (x, y, moveto) =>
                {
                    int nextx = GFXUtil.FloatToInt(x);
                    int nexty = GFXUtil.FloatToInt(y);

                    if (!moveto)
                    {
                        Line_Internal(penx, peny, nextx, nexty, false);
                    }

                    penx = nextx;
                    peny = nexty;
                }, clipbuffer[l], clipbuffer[l + 1]);
            }
        }