Seems like a good idea to me.  I'm a little surprised we haven't seen 
this case before.  Thanks for the patch -- it's committed in SVN r4391.

Cheers,
Mike

Ben North wrote:
> Hi,
> 
> I think there is a bug in the PostScript backend, when trying to draw a
> polygon with zero linewidth.  If you have a zero linewidth, the
> generated PostScript is along the lines of
> 
>    173.31 49.274 m
>    305.066 57.999 l
>    173.533 46.684 l
>    closepath
>    gsave
>    fill
>    grestore
> 
> whereas if there is a non-zero linewidth, you get
> 
>    173.31 49.274 m
>    305.066 57.999 l
>    173.533 46.684 l
>    closepath
>    gsave
>    fill
>    grestore
>    stroke
> 
> The problem is that in the zero-linewidth case, the path is not cleared.
> Therefore, next time there is a 'stroke', that part of the path is
> stroked.  In theory, this doesn't matter because its linewidth is zero,
> but the PostScript docs say not completely unambiguously that a
> zero-width line is as thin as the device allows.  Ghostview, for
> instance, makes this noticeably non-zero-width and the result looks
> wrong.  Besides, it seems cleaner to leave the current path in the same
> state (i.e., empty) in both cases.  The below patch, against SVN head,
> seems to fix this.
> 
> Ben.
> 
> - - - - 8< - - - -
> 
> --- SVN--backend_ps.py  2007-11-20 12:08:51.036996600 +0000
> +++ backend_ps.py       2007-11-20 12:09:00.100300100 +0000
> @@ -947,6 +947,9 @@
> 
>          if self.linewidth > 0:
>              write("stroke\n")
> +        else:
> +            write("newpath\n")
> +
>          if cliprect:
>              write("grestore\n")
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to