[pstricks] Shifted lines when shadowed
Denis Girou
Denis.Girou at idris.fr
Mon Jul 21 19:18:10 CEST 2003
>>>>> "Raphael.Clifford" == Raphael Clifford <raphael.clifford at jesus.ox.ac.uk> writes:
Raphael.Clifford> Does anyone know why the origin gets shifted after a line is shadowed?
Raphael.Clifford> ...
Raphael.Clifford> \psline[shadow=true](0,0.0)(3,0.0)
Raphael.Clifford> \psline[shadow=true](0,0.2)(3,0.2)
Raphael.Clifford> \psline[shadow=true](0,0.4)(3,0.4)
Raphael.Clifford> \psline[shadow=true](0,0.6)(3,0.6)
Raphael.Clifford> \psline[shadow=true](0,0.8)(3,0.8)
Raphael.Clifford> ...
They were two % missing in the code of the \pst at openshadow macro,
introducing a spurious blank. This bug was never diagnosed before,
because spurious blanks are often difficult to detect, and also because
I think this is uncommon to add a shadow to opened curves (the code
of the \pst at closedshadow for closed curves, more often used, has not
this problem).
Thanks for the report!
\documentclass{report}
\usepackage{pstricks}
\pagestyle{empty}
\begin{document}
\psset{shadow=true}
\begin{pspicture}(4,4)
\psline(0,0.0)(3,0.0)
\psline(0,0.2)(3,0.2)
\psline(0,0.4)(3,0.4)
\psline(0,0.6)(3,0.6)
\psline(0,0.8)(3,0.8)
\end{pspicture}
%
\makeatletter
\def\pst at openshadow{%
\addto at pscode{%
gsave
\psk at shadowsize \psk at shadowangle \tx at PtoC
\tx at Shadow
\pst at usecolor\psshadowcolor
\ifx\psk at fillstyle\relax\else
gsave fill grestore
\fi
stroke}%
\pst at repeatarrows
% D.G. modification begin - Jul. 21, 2003
%\addto at pscode{grestore}
\addto at pscode{grestore}%
% D.G. modification end
\ifx\psk at fillstyle\relax\else
\addto at pscode{%
gsave
\pst at usecolor\psfillcolor
gsave fill grestore
stroke
% D.G. modification begin - Jul. 21, 2003
%grestore}
grestore}%
% D.G. modification end
\fi}
\makeatother
%
\hfill
\begin{pspicture}(4,4)
\psline(0,0.0)(3,0.0)
\psline(0,0.2)(3,0.2)
\psline(0,0.4)(3,0.4)
\psline(0,0.6)(3,0.6)
\psline(0,0.8)(3,0.8)
\end{pspicture}
\end{document}
D.G.
More information about the PSTricks
mailing list