[pstricks] Transparency - Problem very ... odd

Loïc xlogo at free.fr
Sun Jul 2 17:15:03 CEST 2006


Hi,

Look at this first code: I fill a polygon with transparency color:


\documentclass[10pt]{article}
\usepackage{pstricks,pst-xkey,pstricks-add}
\makeatletter
\define at key[psset]{}{transpalpha}{\pst at checknum{#1}\pstranspalpha}
\psset{transpalpha=1}
\def\psfs at transp{%
 \addto at pscode{/Normal .setblendmode \pstranspalpha .setshapealpha }
\psfs at solid}
\makeatother
\begin{document}
\psset{dotstyle=*,dotsize=1pt 0,linewidth=0.1pt}
\begin{pspicture*}(-5,-5)(5,5)
\psaxes[Dx=2,Dy=2]{->}(0,0)(-5,-5)(5,5)
\pspolygon[fillstyle=transp,fillcolor=gray,transpalpha=0.1](-1,-1)(-2,4)(1,2)(4,2) 
%
%%%%%%%%%%%%%%%%%%
\psline(3.9,5.53)(3.9,0)
%%%%%%%%%%%%%%%%%%
\end{pspicture*}
\end{document}


The psline between the two lines with %%%%%%%%%%%%%%%%% joins the two 
points (3.9,5.53) and (3.9,0). This psline appears to be after the  
xunit 4!


When I retry this code with a fillstyle solid and no transparency, 
there's no problem.

\documentclass[10pt]{article}
\usepackage{pstricks,pst-xkey,pstricks-add}
\makeatletter
\define at key[psset]{}{transpalpha}{\pst at checknum{#1}\pstranspalpha}
\psset{transpalpha=1}
\def\psfs at transp{%
 \addto at pscode{/Normal .setblendmode \pstranspalpha .setshapealpha }
\psfs at solid}
\makeatother
\begin{document}
\psset{dotstyle=*,dotsize=1pt 0,linewidth=0.1pt}
\begin{pspicture*}(-5,-5)(5,5)
\psaxes[Dx=2,Dy=2]{->}(0,0)(-5,-5)(5,5)
\pspolygon[fillstyle=solid,fillcolor=gray](-1,-1)(-2,4)(1,2)(4,2) %
%%%%%%%%%%%%%%%%%%
\psline(3.9,5.53)(3.9,0)
%%%%%%%%%%%%%%%%%%
\end{pspicture*}
\end{document}


How can I do if I  want to avoid this precision error?

Best
Loïc



More information about the PSTricks mailing list