Ejemplo n.º 1
0
 public void rel_to_abs(ref double x, ref double y)
 {
     if (vertices.total_vertices() != 0)
     {
         double x2;
         double y2;
         if (ShapePath.is_vertex(vertices.last_vertex(out x2, out y2)))
         {
             x += x2;
             y += y2;
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// <para>Draws a quadratic Bézier curve from the current point to (x,y).</para>
        /// <para>The control point is assumed to be the reflection of the control point on the previous command relative to the current point.</para>
        /// <para>(If there is no previous command or if the previous command was not a curve, assume the control point is coincident with the current point.)</para>
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        public void curve3(double x, double y)
        {
            double x0;
            double y0;

            if (ShapePath.is_vertex(vertices.last_vertex(out x0, out y0)))
            {
                double x_ctrl;
                double y_ctrl;
                ShapePath.FlagsAndCommand cmd = vertices.prev_vertex(out x_ctrl, out y_ctrl);
                if (ShapePath.is_curve(cmd))
                {
                    x_ctrl = x0 + x0 - x_ctrl;
                    y_ctrl = y0 + y0 - y_ctrl;
                }
                else
                {
                    x_ctrl = x0;
                    y_ctrl = y0;
                }
                curve3(x_ctrl, y_ctrl, x, y);
            }
        }