Skip to content

Commit

Permalink
feat: allow empty value for /pgf/arrow keys/fill
Browse files Browse the repository at this point in the history
  • Loading branch information
hmenke committed Jul 15, 2024
1 parent 44f8137 commit 8606b49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion doc/generic/pgf/pgfmanual-en-tikz-arrows.tex
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ \subsubsection{Coloring}
filled.
\end{key}

\begin{key}{/pgf/arrow keys/fill=\meta{color or |none|}}
\begin{key}{/pgf/arrow keys/fill=\meta{color or |none| or empty}}
Use this key to explicitly set the color used for filling the arrow tips.
This color can be different from the color used to draw (stroke) the arrow
tip:
Expand All @@ -818,6 +818,11 @@ \subsubsection{Coloring}
}
\end{codeexample}
%
If the argument is left empty or omitted altogether, no explicit fill color
will be set, meaning that the fill color will be determined by whatever was
used last as a fill color. In case that the ``current'' fill color is
intended, it is better to explicitly use |fill=.|.

Note that such ``open'' arrow tips are a bit difficult to draw in some
case: The problem is that the line must be shortened by just the right
amount so that it ends exactly on the back end of the arrow tip. In some
Expand Down
9 changes: 5 additions & 4 deletions tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,13 @@
fill/.code={%
\def\pgf@temp{#1}%
\ifx\pgf@temp\pgf@nonetext%
\pgfarrowsaddtooptions{\pgfarrowopentrue}
\pgfarrowsaddtooptions{\pgfarrowopentrue}%
\else\ifx\pgf@temp\pgfkeysnovalue@text%
\pgfarrowsaddtooptions{\pgfarrowopenfalse}%
\else
\pgfarrowsaddtooptions{\pgfarrowopenfalse\def\pgf@arrows@fill@color{#1}}
\fi
\pgfarrowsaddtooptions{\pgfarrowopenfalse\def\pgf@arrows@fill@color{#1}}%
\fi\fi
},
fill/.value required,
open/.style={fill=none},
.unknown/.code={
\expandafter\pgfutil@in@\expandafter!\expandafter{\pgfkeyscurrentname}%
Expand Down

0 comments on commit 8606b49

Please sign in to comment.