Closed michaelrsweet closed 16 years ago
CUPS.org User: martin.pitt.canonical
The second random example I found is at http://en.wikipedia.org/wiki/HPGL, which does not work any more either.
CUPS.org User: martin.pitt.canonical
There also seem to be a couple of places left which were not adapted to the "shifted by 1" pen enumeration, like filter/hpgl-vector.c:396
PenNumber = (int)decode_number(&s, base_bits, 1.0);
or filter/hpgl-attr.c:217
for (i = 0; i <= PenCount; i ++)
Those were the two places I found after a cursory inspection.
As for the regression, it seems that pen 1 does not work any more. If I replace "SP1;" with "SP2", it works. I think the reason for that is PC_pen_color(). Pens[0] has always been white (before and after the patch), Pens[1] has always been black. However, "SP1" in the past was Pens[1], while it is now Pens[0], and "SP0" (which was valid before) isn't any more. Therefore I think the fix is to revert the "-1" in SP and just make sure that the array does not overflow by 1.
CUPS.org User: martin.pitt.canonical
I think I got it right now. I reverted the SP_select_pen() enumeration change to not break the color map, and fixed the remaining loop. The "PenNumber = " in hpgl-vector.c is correct then, too.
CUPS.org User: martin.pitt.canonical
This is a contentless ping to avoid this mercyless auto-timeout of bug reports.
CUPS.org User: mike
Martin,
I only close stale bugs that I am waiting for information from the reporter, so as long as the status is "pending" the bug is safe...
Also, I'll have you know that my index finger always mercifully clicks the mouse button when closing inactive bugs! :)
CUPS.org User: mike
Fixed in Subversion repository.
"str2966.patch":
--- filter/hpgl-attr.c (revision 8118) +++ filter/hpgl-attr.c (working copy) @@ -3,7 +3,7 @@ *
for (i = 0; i < PenCount; i ++) Pens[i].width = PenWidth;
PC_pencolor(0, NULL); @@ -232,14 +232,14 @@ int i; /* Looping var / static float standardcolors[8][3] = / Standard colors for first 8 pens */ {
--- filter/hpgl-vector.c (revision 8118) +++ filter/hpgl-vector.c (working copy) @@ -3,7 +3,7 @@ *
fprintf(stderr, "DEBUG: set pen #%d\n", PenNumber + 1);
Outputf("%% PE: set pen #%d\n", PenNumber);
Outputf("%% PE: set pen #%d\n", PenNumber + 1);
if (PageDirty) printf("%.3f %.3f %.3f %.2f SP\n", Pens[PenNumber].rgb[0],
Version: 1.3.9 CUPS.org User: martin.pitt.canonical
I tested ftp://ftp.ornl.gov/pub/ortep/examples/ahelix.hp before and after the patch in STR #1911:
filter/hpgltops 1 martin test 1 '' /tmp/ahelix.hp > /tmp/x.ps evince /tmp/x.ps
and with the patch I just get a blank page. I suspect it is due to the shifted pen enumeration, which now starts counting at 0 instead of 1.