diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex | 88 |
1 files changed, 80 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex index bdf4906c1be..19e73e0b44e 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex @@ -7,7 +7,7 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.8 2007/06/07 07:41:10 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.11 2008/04/23 14:59:01 tantau Exp $ % Sets the end arrow @@ -89,7 +89,7 @@ % Called when an arrow needs to be rendered \def\pgf@arrow@call#1{% - \expandafter\ifx\csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname\relax% + \expandafter\ifx\csname\pgf@arrow@full@name{#1}\endcsname\relax% \pgfsysprotocol@getcurrentprotocol\pgf@arrow@temp% {% \pgfinterruptpath% @@ -105,13 +105,15 @@ \global\let\pgf@@arrow@temp=\pgf@@arrow@temp% \endpgfinterruptpath% \expandafter\def\expandafter\pgf@temp\expandafter{\expandafter\pgfsys@invoke\expandafter{\pgf@@arrow@temp}}% - \expandafter\global\expandafter\let\csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname=\pgf@temp% + \expandafter\global\expandafter\let\csname\pgf@arrow@full@name{#1}\endcsname=\pgf@temp% }% \pgfsysprotocol@setcurrentprotocol\pgf@arrow@temp% \fi% - \csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname% + \csname\pgf@arrow@full@name{#1}\endcsname% } +\def\pgf@arrow@full@name#1{pgf@arrow@prot@#1@\the\pgflinewidth @\pgfinnerlinewidth @\pgfgetarrowoptions{#1}} + \def\pgf@arrow@code@{} % dummy \def\pgf@nousepath@here#1{% @@ -119,6 +121,41 @@ } +% Get options for an arrow +% +% #1 = arrow tip name +% +% Description: +% +% For every arrow tip certain options can be set, which may influence +% the appearance of the arrow tip. How the options are used is up the +% arrow tip code. This command will expand to the current value of +% the options for this tip. The default is 0. + +\def\pgfgetarrowoptions#1{% + \expandafter\ifx\csname pgf@arrow@opt@#1\endcsname\relax0\else\csname pgf@arrow@opt@#1\endcsname\fi% +} + + +% Set options for an arrow +% +% #1 = arrow tip name +% #2 = options +% +% Description: +% +% Sets the arrow tip options for an arrow. The options should be a +% normal string and will be used to detect whether an arrow should be +% recached. For instance, when you set the arrow tip options of +% "myarrow" to "1", the arrow will be rendered in a certain way. Then, +% when you set the options to "2", the arrow will be rerendered. + +\def\pgfsetarrowoptions#1#2{% + \expandafter\def\csname pgf@arrow@opt@#1\endcsname{#2}% +} + + + % Define an arrow type. % @@ -374,13 +411,21 @@ \pgfarrowsdeclare{stealth}{stealth} { \pgfutil@tempdima=0.28pt% - \advance\pgfutil@tempdima by.3\pgflinewidth% + \pgfutil@tempdimb=\pgflinewidth% + \ifdim\pgfinnerlinewidth>0pt% + \pgfmathsetlength\pgfutil@tempdimb{.6\pgflinewidth-.4*\pgfinnerlinewidth}% + \fi% + \advance\pgfutil@tempdima by.3\pgfutil@tempdimb% \pgfarrowsleftextend{+-3\pgfutil@tempdima} \pgfarrowsrightextend{+5\pgfutil@tempdima} } { \pgfutil@tempdima=0.28pt% - \advance\pgfutil@tempdima by.3\pgflinewidth% + \pgfutil@tempdimb=\pgflinewidth% + \ifdim\pgfinnerlinewidth>0pt% + \pgfmathsetlength\pgfutil@tempdimb{.6\pgflinewidth-.4*\pgfinnerlinewidth}% + \fi% + \advance\pgfutil@tempdima by.3\pgfutil@tempdimb% \pgfpathmoveto{\pgfqpoint{5\pgfutil@tempdima}{0pt}} \pgfpathlineto{\pgfqpoint{-3\pgfutil@tempdima}{4\pgfutil@tempdima}} \pgfpathlineto{\pgfpointorigin} @@ -464,13 +509,21 @@ \pgfarrowsdeclare{latex}{latex} { \pgfutil@tempdima=0.28pt% - \advance\pgfutil@tempdima by.3\pgflinewidth% + \pgfutil@tempdimb=\pgflinewidth% + \ifdim\pgfinnerlinewidth>0pt% + \pgfmathsetlength\pgfutil@tempdimb{.6\pgflinewidth-.4*\pgfinnerlinewidth}% + \fi% + \advance\pgfutil@tempdima by.3\pgfutil@tempdimb% \pgfarrowsleftextend{+-1\pgfutil@tempdima} \pgfarrowsrightextend{+9\pgfutil@tempdima} } { \pgfutil@tempdima=0.28pt% - \advance\pgfutil@tempdima by.3\pgflinewidth% + \pgfutil@tempdimb=\pgflinewidth% + \ifdim\pgfinnerlinewidth>0pt% + \pgfmathsetlength\pgfutil@tempdimb{.6\pgflinewidth-.4*\pgfinnerlinewidth}% + \fi% + \advance\pgfutil@tempdima by.3\pgfutil@tempdimb% \pgfpathmoveto{\pgfqpoint{9\pgfutil@tempdima}{0pt}} \pgfpathcurveto {\pgfqpoint{6.3333\pgfutil@tempdima}{.5\pgfutil@tempdima}} @@ -509,5 +562,24 @@ } +% A space arrow +% +% This arrow can be combined with other arrows to add "space" around +% them. +% +% Example: +% +% \pgfarrowsdeclarecombine{my<}{my>}{<}{>}{space}{space} + +\pgfarrowsdeclare{space}{space} +{ + \pgfutil@tempdima=0.88pt% + \advance\pgfutil@tempdima by.3\pgflinewidth% + \pgfarrowsleftextend{0pt} + \pgfarrowsrightextend{\pgfutil@tempdima} +} +{} + + \endinput |