Skip to content

Commit 99e4df4

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 ab7c147 commit 99e4df4

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

doc/generic/pgf/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
2828
- Resolve overfull hboxes >=20pt in the manual
2929
- Adapt `\graphicspath` setting for flattened doc tree #1191
3030
- Promote warning "Plot data file \`...' not found" to error
31+
- Allow empty value for /pgf/arrow keys/fill to make it behave more like /tikz/fill #1352
3132

3233
### Contributors
3334

@@ -38,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
3839
- Qrrbrbirlbel
3940
- quark67
4041
- Rocky Zhang (@rockyzhz)
42+
- Romano Giannetti (@rmano)
4143
- Yukai Chou (@muzimuzhi)
4244
- Alexander Grahn
4345
- Max Chernoff

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)