%
% see pstricks.tex for license and copyright
%
%% Rotating and ref point
%%
\def\tx@Rot{Rot }
\def\psrotateleft{%
\ifPSTlualatex
\def\pst@tempA{-90 }%
\def\pst@tempB{90 }%
\else
\def\pst@tempA{90 }%
\def\pst@tempB{-90 }%
\fi
\pst@makebox{\ps@rotateleft\pst@hbox}}
\def\ps@rotateleft#1{%
\leavevmode\hbox{\hskip\ht#1\hskip\dp#1\vbox{\vskip\wd#1%
\pst@Verb{\pst@tempA \tx@Rot}%
\vbox to \z@{\vss\hbox to \z@{\box#1\hss}\vskip\z@}%
\pst@Verb{\pst@tempB \tx@Rot}}}}
%
\def\psrotateright{%
\ifPSTlualatex
\def\pst@tempA{90 }%
\def\pst@tempB{-90 }%
\else
\def\pst@tempA{-90 }%
\def\pst@tempB{90 }%
\fi
\pst@makebox{\ps@rotateright\pst@hbox}}
\def\ps@rotateright#1{%
% ----------- hv begin 2004-05-07 ----------- patch 15
% \hbox{%
\leavevmode\hbox{%
% ----------- hv end 2004-05-07 ----------- patch 15
\hskip\ht#1\hskip\dp#1\vbox{\vskip\wd#1%
\pst@Verb{\pst@tempA \tx@Rot}
\vbox to \z@{\hbox to \z@{\hss\box#1}\vss}%
\pst@Verb{\pst@tempB \tx@Rot}}}}
\def\psrotatedown{\pst@makebox{\ps@rotatedown\pst@hbox}}
\def\ps@rotatedown#1{%
\hbox{\hskip\wd#1\vbox{\vskip\ht#1\vskip\dp#1%
\pst@Verb{180 \tx@Rot}%
\vbox to \z@{\hbox to \z@{\box#1\hss}\vss}%
\pst@Verb{-180 \tx@Rot}}}}
\pslongbox{Rotateleft}{\psrotateleft}
\pslongbox{Rotateright}{\psrotateright}
\pslongbox{Rotatedown}{\psrotatedown}
% ----------- hv begin 2004-09-23 ----------- 1.11
% compatibility stuff
\let\rotateleft\psrotateleft
\let\rotateright\psrotateright
\let\rotatedown\psrotatedown
% ----------- hv end 2005-09-23 ----------- 1.11
\define@key[psset]{pstricks}{ref}[c]{\pst@expandafter\psset@@ref{#1}\@empty,,\@nil}
\def\psset@@ref#1#2,#3,#4\@nil{%
\def\psk@xref{.5}%
\def\psk@yref{.5}%
\let\pst@makesmall\pst@@@makesmall
\ifx\@empty#3\@empty
\@nameuse{getref@#1}%
\@nameuse{getref@#2}%
\else
\pst@checknum{#1#2}\psk@xref
\pst@checknum{#3}\psk@yref
\fi}
%
\def\getref@c{\let\pst@makesmall\pst@@makesmall}
\def\getref@t{\def\psk@yref{1}}
\def\getref@b{\def\psk@yref{0}}
\def\getref@B{\let\psk@yref\relax}
\def\getref@l{\def\psk@xref{0}}
\def\getref@r{\def\psk@xref{1}}
\psset[pstricks]{ref=c}
%
%
% U Up 0
% L Left 90
% D Down 180
% R Right 270
%
% N North *0
% W West *90
% S South *180
% E East *270
%
\ifPSTlualatex
\def\pst@rotlist{ mark RAngle /ps@a ED cleartomark ps@a }%
\else
\def\pst@rotlist{ mark RAngle /ps@a ED cleartomark ps@a neg }%
\fi