diff options
author | Ray Johnston <ray.johnston@artifex.com> | 2020-02-25 19:59:03 -0800 |
---|---|---|
committer | Ray Johnston <ray.johnston@artifex.com> | 2020-02-25 20:21:34 -0800 |
commit | b3a7357594634fbd89a4cbf782d094289628acd6 (patch) | |
tree | c7f7c1a5497356a5f5b6167ac3a9762cc798507c /base/gxclrast.c | |
parent | ea7aa02cc5c540c3332e0d4e81209a920360d45e (diff) | |
download | ghostpdl-b3a7357594634fbd89a4cbf782d094289628acd6.tar.gz |
Fix bug 702139 - clist clipping bug.
When characters are filled as paths, the fill_adjust may be set to 0.
Clip paths are supposed to match fill paths, i.e. the 'any part of pixel'
rule, so we need fill_adjust of 0.5 (not 0). The most foolproof way to fix
this is to set it in the reader when processing 'begin_clip' and restore
it when handling the end_clip.
There are many progressions with this change, but it also exposes some
cases where the change in clipping allows other elements to be seen that
were previously hidden. Those few instances are minor and mostly seem to
occur when page mode differs from clist mode. Examination of some of those
cases shows that the clip path with clist mode now matches page mode and
other elements (e.g. images) differ in extent between page and clist mode.
Diffstat (limited to 'base/gxclrast.c')
-rw-r--r-- | base/gxclrast.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/base/gxclrast.c b/base/gxclrast.c index 603dc556b..61982fffe 100644 --- a/base/gxclrast.c +++ b/base/gxclrast.c @@ -506,6 +506,7 @@ clist_playback_band(clist_playback_action playback_action, struct _cas { bool lop_enabled; gx_device_color dcolor; + gs_fixed_point fa_save; } clip_save; bool in_clip = false; gs_gstate gs_gstate; @@ -1299,6 +1300,12 @@ set_phase: /* tdev = (gx_device *)&clip_accum; clip_save.lop_enabled = state.lop_enabled; clip_save.dcolor = fill_color; + clip_save.fa_save.x = gs_gstate.fill_adjust.x; + clip_save.fa_save.y = gs_gstate.fill_adjust.y; + /* clip_path should match fill_path, i.e., with fill_adjust applied */ + /* If we get here with the fill_adjust = [0, 0], set it to [0.5, 0.5]i */ + if (clip_save.fa_save.x == 0 || clip_save.fa_save.y == 0) + gs_gstate.fill_adjust.x = gs_gstate.fill_adjust.y = fixed_half; /* temporarily set a solid color */ color_set_pure(&fill_color, (gx_color_index)1); state.lop_enabled = false; @@ -1334,6 +1341,9 @@ set_phase: /* (state.lop_enabled ? state.lop : lop_default); fill_color = clip_save.dcolor; + /* restore the fill_adjust if it was changed by begin_clip */ + gs_gstate.fill_adjust.x = clip_save.fa_save.x; + gs_gstate.fill_adjust.y = clip_save.fa_save.y; in_clip = false; break; case cmd_opv_set_color_space: |