summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-09-21 14:18:08 +0100
committerSam James <sam@gentoo.org>2022-10-02 04:31:25 +0100
commita529111f77ff46f4836fe7312e70953bc16587cf (patch)
tree9dc3924cb1a6ef3ef853b7bb45f735365e0b4e6d /base/gxstroke.c
parentImport Ghostscript 9.56.1 (diff)
downloadghostscript-gpl-patches-ghostscript-10.tar.gz
ghostscript-gpl-patches-ghostscript-10.tar.bz2
ghostscript-gpl-patches-ghostscript-10.zip
Import Ghostscript 10.0ghostscript-10.0ghostscript-10
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'base/gxstroke.c')
-rw-r--r--base/gxstroke.c10
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);