View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000881 | MetaPost | bug | public | 2014-01-24 13:05 | 2014-01-24 13:05 |
Reporter | piotrst | Assigned To | |||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | PC | OS | Linux and Windows | ||
Product Version | 1.780 | ||||
Summary | 0000881: Incorrect MPOST output in degenerated closed path case | ||||
Description | Closed degenerated MPOST path: beginfig(1) draw (0,0)--(0,0) & cycle withpen pencircle scaled 1; endfig; bye. yields a strange and `too simple' result: %!PS %%BoundingBox: -1 -1 1 1 %% ... 0 0 0 setrgbcolor 0 1 dtransform truncate idtransform setlinewidth pop [] 0 setdash 1 setlinejoin 10 setmiterlimit newpath 0 0 moveto closepath stroke showpage which is incorrectly displayed in both Ghostscript and Adobe Reader. | ||||
Steps To Reproduce | Second, let's consider another degenerated case, not covered by Hans's amendment: beginfig(1) draw (0,0)--(0,0) withpen pencircle scaled 1; endfig; bye. The output PostScript code reads (most of comments skipped): %!PS %%BoundingBox: -1 -1 1 1 %% ... 0 0 0 setrgbcolor 0 1 dtransform truncate idtransform setlinewidth pop [] 0 setdash 1 setlinecap 1 setlinejoin 10 setmiterlimit newpath 0 0 moveto 0 0 lineto stroke showpage Ghostscript happily displays the correct, i.e., expected result (Adobe Reader also, after the distillation, of course). A slight modification of the degenerated case: beginfig(1) draw (0,0)--(0,0) & cycle withpen pencircle scaled 1; endfig; bye. yields a slightly modified result: %!PS %%BoundingBox: -1 -1 1 1 %% ... 0 0 0 setrgbcolor 0 1 dtransform truncate idtransform setlinewidth pop [] 0 setdash 1 setlinejoin 10 setmiterlimit newpath 0 0 moveto closepath stroke showpage Now, Gostscript displays nothing, and the respective PDF file does not contain a visible object according to Adobe Reader. The culprit is, somewhat surprisingly, the phrase "1 setlinecap", missing from the PostScript code in the latter case. (Observe that "1 setlinejoin" does not help.) | ||||
Additional Information | So, we would advise that the phrase "1 setlinecap" should be issued in degenerated cases (at least), to avoid admittedly rare but surprising results. Perhaps advisable would be replacing the phrase "0 0 moveto" by "0 0 moveto 0 0 rlineto", but we're not sure. | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2014-01-24 13:05 | piotrst | New Issue |