diff options
Diffstat (limited to 'base/gxstroke.c')
-rw-r--r-- | base/gxstroke.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/base/gxstroke.c b/base/gxstroke.c index 6546e00b..34537843 100644 --- a/base/gxstroke.c +++ b/base/gxstroke.c @@ -558,7 +558,7 @@ gx_stroke_path_only_aux(gx_path *ppath, /* lgtm[cpp/use-of-goto] */ double device_dot_length = pgs_lp->dot_length * fixed_1; const subpath *psub; gs_matrix initial_matrix; - bool initial_matrix_reflected; + bool initial_matrix_reflected, flattened_path = false; note_flags flags; (*dev_proc(pdev, get_initial_matrix)) (pdev, &initial_matrix); @@ -741,6 +741,7 @@ gx_stroke_path_only_aux(gx_path *ppath, /* lgtm[cpp/use-of-goto] */ ) return code; spath = &fpath; + flattened_path = true; } if (dash_count) { float max_dash_len = 0; @@ -1137,7 +1138,8 @@ gx_stroke_path_only_aux(gx_path *ppath, /* lgtm[cpp/use-of-goto] */ exf: if (dash_count) gx_path_free(&dpath, "gx_stroke_path exit(dash path)"); - if (ppath->curve_count) + /* If we flattened the path then we set spath to &fpath. If we flattned the path then now we need to free fpath */ + if(flattened_path) gx_path_free(&fpath, "gx_stroke_path exit(flattened path)"); return code; } @@ -2728,7 +2730,9 @@ add_pie_join(gx_path * ppath, pl_ptr plp, pl_ptr nplp, bool reflected, r = (double)(nplp->width.x) /* x2 */ * (plp->width.y) /* y1 */; if (l == r) { - if (cap) + /* Colinear. Suppress drawing a cap unless the path reverses direction. */ + if (cap && + ((double)(plp->width.x) * (nplp->width.x) + (double)(nplp->width.y) * (plp->width.y)) < 0) return add_pie_cap(ppath, &plp->e); else return gx_path_add_line(ppath, plp->e.ce.x, plp->e.ce.y); |