Exemplo n.º 1
0
        internal override void TransformFlatten(ref double penx, ref double peny, double tol, Transform2d t, FlattenCallback lcb)
        {
            double xs, ys, c1x, c1y, c2x, c2y, xe, ye;

            t.Apply(penx, peny, out xs, out ys, true);
            t.Apply(XC1, YC1, out c1x, out c1y, true);
            t.Apply(XC2, YC2, out c2x, out c2y, true);
            t.Apply(X, Y, out xe, out ye, true);
            GeomUtil.FlattenBezier(xs, ys, c1x, c1y, c2x, c2y, xe, ye, false, tol, lcb);
            penx = X;
            peny = Y;
        }
Exemplo n.º 2
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, Clip.XMin, Clip.YMin, Clip.XMax, Clip.YMax);
            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)
                    {
                        DrawLine(penx, peny, nextx, nexty);
                    }

                    penx = nextx;
                    peny = nexty;
                }, clipbuffer[l], clipbuffer[l + 1]);
            }
        }
Exemplo n.º 3
0
 internal override void Flatten(ref double penx, ref double peny, double tol, FlattenCallback lcb)
 {
     GeomUtil.FlattenBezier(penx, peny, XC1, YC1, XC2, YC2, X, Y, false, tol, lcb);
     penx = X;
     peny = Y;
 }