/// <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); } }
public void curve4(double x_ctrl2, double y_ctrl2, double x_to, double y_to) { double x0; double y0; if (ShapePath.is_vertex(last_vertex(out x0, out y0))) { double x_ctrl1; double y_ctrl1; ShapePath.FlagsAndCommand cmd = prev_vertex(out x_ctrl1, out y_ctrl1); if (ShapePath.is_curve(cmd)) { x_ctrl1 = x0 + x0 - x_ctrl1; y_ctrl1 = y0 + y0 - y_ctrl1; } else { x_ctrl1 = x0; y_ctrl1 = y0; } curve4(x_ctrl1, y_ctrl1, x_ctrl2, y_ctrl2, x_to, y_to); } }