🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.ghostscript.bug
Article #127

Bug in ghostscript 2.4's reflected stroke joints

#127
From: Pavel Curtis
Date: Mon, 13 Apr 1992 23:14
43 lines
2012 bytes
I believe that there is a bug in ghostscript version 2.4, in the rendering of
strokes under reflected transformations; the following small PS file exhibits
the problem:

		      50 600 translate 1 -1 scale
		      30 setlinewidth
		      0 setlinejoin
		      0 setlinecap
		      100 100 moveto
		      0 100 rlineto
		      100 0 rlineto
		      closepath
		      stroke

As is, the mitered joints on the stroke do not appear; the output looks as if
the three lines of the triangle had been drawn as individual strokes, each with
butt caps.  If the first line, which establishes the reflected transformation,
is commented out, the triangle appears as expected, with normal mitered joints.

My guess, from taking a brief look at the code, is that the bug is in the
function stroke_add (file gxstroke.c), in the section of code with the
following comment:

		/*
		 * Set np to whichever of nplp->o.co or .ce
		 * is outside the current line.
		 * We use the interesting observation that
		 * point (x2,y2) is counter-clockwise from (x1,y1)
		 * relative to the origin iff x1*y2 < x2*y1.
		 * In this case x1,y1 are plp->width,
		 * x2,y2 are nplp->width, and the origin is
		 * their common point (plp->e.p, nplp->o.p).
		 */

This comment does appear (to me, anyway) to be taking into account that the
transformation might be reflected, so that clockwise is not in the direction it
expects.  This is sheer speculation on my part, though.

	Pavel
--

>>> I've joined the League for Programming Freedom; have you?
>>> Write me or league@prep.ai.mit.edu for information.
Technical Details
Message-ID: <pavel.703206856@lambda>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!parc.xerox.COM!pavel

Show Full Headers
Complete Article Headers
Newsgroups: gnu.ghostscript.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!parc.xerox.COM!pavel
From: pavel@parc.xerox.COM (Pavel Curtis)
Subject: Bug in ghostscript 2.4's reflected stroke joints
Message-ID: <pavel.703206856@lambda>
Sender: gnulists@ai.mit.edu
Organization: Xerox PARC
Distribution: gnu
Date: Mon, 13 Apr 1992 23:14:16 GMT
Approved: bug-ghostscript@prep.ai.mit.edu
Lines: 45