Skip to content

Commit 25893b1

Browse files
hmenkemuzimuzhiRmano
committed
feat: allow empty value for /pgf/arrow keys/fill
Signed-off-by: Henri Menke <henri@henrimenke.de> Co-authored-by: Yukai Chou <muzimuzhi@gmail.com> Co-authored-by: Romano Giannetti <romano.giannetti@gmail.com>
1 parent 44f8137 commit 25893b1

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

doc/generic/pgf/pgfmanual-en-tikz-arrows.tex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ \subsubsection{Coloring}
796796
filled.
797797
\end{key}
798798

799-
\begin{key}{/pgf/arrow keys/fill=\meta{color or |none|}}
799+
\begin{key}{/pgf/arrow keys/fill=\meta{color} (default \normalfont is scope's color setting)}
800800
Use this key to explicitly set the color used for filling the arrow tips.
801801
This color can be different from the color used to draw (stroke) the arrow
802802
tip:
@@ -818,6 +818,10 @@ \subsubsection{Coloring}
818818
}
819819
\end{codeexample}
820820
%
821+
If the argument is left empty or omitted altogether, no explicit fill color
822+
will be set, meaning that the fill color will be determined by whatever was used
823+
last as a fill color in the current scope.
824+
821825
Note that such ``open'' arrow tips are a bit difficult to draw in some
822826
case: The problem is that the line must be shortened by just the right
823827
amount so that it ends exactly on the back end of the arrow tip. In some
@@ -827,7 +831,7 @@ \subsubsection{Coloring}
827831
A shorthand for |fill=none|.
828832
\end{key}
829833

830-
When you use both the |color| and |fill| option, the |color| option must
834+
When you use both the |color| and |fill| options, the |color| option must
831835
come first since it will reset the filling to the color specified for
832836
drawing.
833837
%

tex/generic/pgf/basiclayer/pgfcorearrows.code.tex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,14 @@
510510
fill/.code={%
511511
\def\pgf@temp{#1}%
512512
\ifx\pgf@temp\pgf@nonetext%
513-
\pgfarrowsaddtooptions{\pgfarrowopentrue}
513+
\pgfarrowsaddtooptions{\pgfarrowopentrue}%
514+
\else\ifx\pgf@temp\pgfutil@empty%
515+
\pgfarrowsaddtooptions{\pgfarrowopenfalse}%
514516
\else
515-
\pgfarrowsaddtooptions{\pgfarrowopenfalse\def\pgf@arrows@fill@color{#1}}
516-
\fi
517+
\pgfarrowsaddtooptions{\pgfarrowopenfalse\def\pgf@arrows@fill@color{#1}}%
518+
\fi\fi
517519
},
518-
fill/.value required,
520+
fill/.default=,
519521
open/.style={fill=none},
520522
.unknown/.code={
521523
\expandafter\pgfutil@in@\expandafter!\expandafter{\pgfkeyscurrentname}%

0 commit comments

Comments
 (0)