static void
-dia_bezier(point * A, int n, int arrow_at_start, int arrow_at_end)
+dia_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
{
int i, conn_h, conn_t;
pointf p, firstp = { 0, 0 }, llp = {
tmplist[j].y += offlist[j].y;
}
gvrender_beziercurve(gvc, tmplist, tmpspl.list[i].size,
- FALSE, FALSE);
+ FALSE, FALSE, FALSE);
}
}
xdemitState = EMIT_TDRAW;
P2PF(bz.list[j], bzf.list[j]);
if (gvrender_features(gvc) & GVRENDER_DOES_ARROWS) {
gvrender_beziercurve(gvc, bzf.list, bz.size, bz.sflag,
- bz.eflag);
+ bz.eflag, FALSE);
} else {
gvrender_beziercurve(gvc, bzf.list, bz.size, FALSE,
- FALSE);
+ FALSE, FALSE);
xdemitState = EMIT_TDRAW;
if (bz.sflag)
arrow_gen(gvc, bz.sp, bz.list[0], scale, bz.sflag);
}
static void fig_bezier(point * A, int n, int arrow_at_start,
- int arrow_at_end)
+ int arrow_at_end, int filled)
{
int object_code = 3; /* always 3 for spline */
int sub_type = 4; /* always 4 for opened X-spline */
}
static void
-gd_bezier(point * A, int n, int arrow_at_start, int arrow_at_end)
+gd_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
{
- pointf p0, p1, V[4];
+ pointf p, p0, p1, V[4];
int i, j, step;
int style[20];
int pen, width;
gdImagePtr brush = NULL;
+ gdPoint F[4];
if (!im)
return;
width = cstk[SP].penwidth;
gdImageSetThickness(im, width);
#endif
+ p.x = A[0].x;
+ p.y = A[0].y;
+ p = gdpt(p);
+ F[0].x = ROUND(p.x);
+ F[0].y = ROUND(p.y);
+ p.x = A[n-1].x;
+ p.y = A[n-1].y;
+ p = gdpt(p);
+ F[3].x = ROUND(p.x);
+ F[3].y = ROUND(p.y);
V[3].x = A[0].x;
V[3].y = A[0].y;
for (i = 0; i + 3 < n; i += 3) {
NULL));
gdImageLine(im, ROUND(p0.x), ROUND(p0.y), ROUND(p1.x),
ROUND(p1.y), pen);
+ if (filled) {
+ F[1].x = ROUND(p0.x);
+ F[1].y = ROUND(p0.y);
+ F[2].x = ROUND(p1.x);
+ F[2].y = ROUND(p1.y);
+ gdImageFilledPolygon(im, F, 4, cstk[SP].fillcolor);
+ }
p0 = p1;
}
}
}
static void hpgl_bezier(point * A, int n, int arrow_at_start,
- int arrow_at_end)
+ int arrow_at_end, int filled)
{
char buffer[32];
int j;
}
static void mif_bezier(point * A, int n, int arrow_at_start,
- int arrow_at_end)
+ int arrow_at_end, int filled)
{
fprintf(Output_file,
"<PolyLine <Fill 15> <Smoothed Yes> <HeadCap Square>\n");
}
static void
-mp_bezier(point * A, int n, int arrow_at_start, int arrow_at_end)
+mp_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
{
int j;
if (arrow_at_start || arrow_at_end)
}
static void pic_bezier(point * A, int n, int arrow_at_start,
- int arrow_at_end)
+ int arrow_at_end, int filled)
{
pointf V[4], p;
int i, j, m, step;
}
static void
-ps_bezier(point * A, int n, int arrow_at_start, int arrow_at_end)
+ps_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
{
int j;
if (S[SP].invis)
return;
+ if (filled && *S[SP].fillcolor) {
+ ps_set_color(S[SP].fillcolor);
+ fprintf(Output_file, Newpath_Moveto, A[0].x, A[0].y);
+ for (j = 1; j < n; j += 3)
+ fprintf(Output_file, "%d %d %d %d %d %d curveto\n",
+ A[j].x, A[j].y, A[j + 1].x, A[j + 1].y, A[j + 2].x,
+ A[j + 2].y);
+ fprintf(Output_file, "closepath\n");
+ fprintf(Output_file, Fill);
+ if (*S[SP].pencolor)
+ ps_set_color(S[SP].pencolor);
+ }
if (*S[SP].pencolor == '\0')
return;
if (arrow_at_start || arrow_at_end)
B[i++] = B[2];
if (mode == ROUNDED) {
+ if (style & FILLED) {
+ int j = 0;
+ char* fillc = findFill(n);
+ point* pts = N_GNEW(2*sides,point);
+ gvrender_set_pencolor (gvc, fillc);
+ gvrender_set_fillcolor (gvc, fillc);
+ for (seg = 0; seg < sides; seg++) {
+ pts[j++] = B[4 * seg + 1];
+ pts[j++] = B[4 * seg + 2];
+ }
+ gvrender_polygon(gvc, pts, 2*sides, TRUE);
+ free (pts);
+ for (seg = 0; seg < sides; seg++) {
+ for (i = 0; i < 4; i++)
+ P2PF(B[4 * seg + 2 + i], BF[i]);
+ gvrender_beziercurve(gvc, BF, 4, FALSE, FALSE, TRUE);
+ }
+ }
+ pencolor(gvc, n);
for (seg = 0; seg < sides; seg++) {
gvrender_polyline(gvc, B + 4 * seg + 1, 2);
/* convert to floats for gvrender api */
for (i = 0; i < 4; i++)
P2PF(B[4 * seg + 2 + i], BF[i]);
- gvrender_beziercurve(gvc, BF, 4, FALSE, FALSE);
+ gvrender_beziercurve(gvc, BF, 4, FALSE, FALSE, FALSE);
}
} else { /* diagonals are weird. rewrite someday. */
pencolor(gvc, n);
}
static void
-svg_bezier(point * A, int n, int arrow_at_start, int arrow_at_end)
+svg_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
{
if (cstk[SP].pen == P_NONE) {
/* its invisible, don't draw */
void (*ellipse) (point p, int rx, int ry, int filled);
void (*polygon) (point * A, int n, int filled);
void (*beziercurve) (point * A, int n, int arrow_at_start,
- int arrow_at_end);
+ int arrow_at_end, int filled);
void (*polyline) (point * A, int n);
boolean bezier_has_arrows;
void (*comment) (char *str);
}
static void
-vrml_bezier(point * A, int n, int arrow_at_start, int arrow_at_end)
+vrml_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
{
pointf p1, V[4];
int i, j, step;
}
static void vtx_bezier(point * A, int n, int arrow_at_start,
- int arrow_at_end)
+ int arrow_at_end, int filled)
{
if (arrow_at_start) {
vtx_bzptarray(A, n - 2, 0);
}
static void
-xd_bezier(point * A, int n, int arrow_at_start, int arrow_at_end)
+xd_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
{
- xd_points('B', A, n);
+ if (filled)
+ xd_points('B', A, n);
+ else
+ xd_points('b', A, n);
}
static void xd_polyline(point * A, int n)
extern void gvrender_polygon(GVC_t * gvc, point * A, int n,
int filled);
extern void gvrender_beziercurve(GVC_t * gvc, pointf * AF, int n,
- int arrow_at_start, int arrow_at_end);
+ int arrow_at_start, int arrow_at_end, int);
extern void gvrender_polyline(GVC_t * gvc, point * A, int n);
extern void gvrender_comment(GVC_t * gvc, char *str);
extern void gvrender_user_shape(GVC_t * gvc, char *name, point * A,
void (*ellipse) (gvrender_job_t * job, pointf * A, int filled);
void (*polygon) (gvrender_job_t * job, pointf * A, int n, int filled);
void (*beziercurve) (gvrender_job_t * job, pointf * A, int n,
- int arrow_at_start, int arrow_at_end);
+ int arrow_at_start, int arrow_at_end, int);
void (*polyline) (gvrender_job_t * job, pointf * A, int n);
void (*comment) (gvrender_job_t * job, char *comment);
void (*user_shape) (gvrender_job_t * job, char *name, pointf * A, int sides,
}
void gvrender_beziercurve(GVC_t * gvc, pointf * AF, int n,
- int arrow_at_start, int arrow_at_end)
+ int arrow_at_start, int arrow_at_end, int filled)
{
gvrender_job_t *job = gvc->job;
gvrender_engine_t *gvre = job->render_engine;
}
for (i = 0; i < n; i++)
AF2[i] = gvrender_ptf(job, AF[i]);
- gvre->beziercurve(job, AF2, n, arrow_at_start, arrow_at_end);
+ gvre->beziercurve(job, AF2, n, arrow_at_start, arrow_at_end,filled);
}
}
#ifndef DISABLE_CODEGENS
/* end hack */
if (cg && cg->beziercurve)
- cg->beziercurve(A, n, arrow_at_start, arrow_at_end);
+ cg->beziercurve(A, n, arrow_at_start, arrow_at_end, filled);
}
#endif
}