diff options
author | Henry Stiles <henry.stiles@artifex.com> | 1999-02-07 09:42:47 +0000 |
---|---|---|
committer | Henry Stiles <henry.stiles@artifex.com> | 1999-02-07 09:42:47 +0000 |
commit | 5b49728e19b5539e5e9db4355f1cc7d7837e4d8e (patch) | |
tree | f40f41bd17632f53434b4b765ffb863cf0b677d9 /pcl/pglfill.c | |
parent | 8dc2f07ca031c30e7c68868d8452a95c9ec61e11 (diff) |
Addition to properly select and wrap the current pen. Adds an
accessor function for getting the currently selected pen.
git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@686 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pcl/pglfill.c')
-rw-r--r-- | pcl/pglfill.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pcl/pglfill.c b/pcl/pglfill.c index b6edfdc95..ba0cf1264 100644 --- a/pcl/pglfill.c +++ b/pcl/pglfill.c @@ -392,8 +392,7 @@ hpgl_PW( /* * we maintain the line widths in plotter units, irrespective - * of current units (WU). They width argument to PW are mm - * (I suspect this is incorrect - jan) + * of current units (WU). */ if (hpgl_arg_c_real(pargs, ¶m)) { if (hpgl_arg_c_int(pargs, &pmin)) { @@ -621,13 +620,15 @@ hpgl_SP( ) { int pen = 0; - int npen = pcl_palette_get_num_entries(pgls->ppalet); + /* palette pen numbers are always consecutive integers starting + with 0 */ + int max_pen = pcl_palette_get_num_entries(pgls->ppalet) - 1; if (hpgl_arg_c_int(pargs, &pen)) { if (pen < 0) return e_Range; - else if (pen > npen) - pen = (pen % (npen - 1)) + 1; + while ( pen > max_pen ) + pen = pen - max_pen; } hpgl_call(hpgl_draw_current_path(pgls, hpgl_rm_vector)); pgls->g.pen.selected = pen; |