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
Signed-off-by: Henri Menke <[email protected]>
Co-authored-by: Yukai Chou <[email protected]>
Co-authored-by: Romano Giannetti <[email protected]>
  • Loading branch information
3 people committed Jul 19, 2024
1 parent 44f8137 commit ffb5f4f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions doc/generic/pgf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Resolve overfull hboxes >=20pt in the manual
- Adapt `\graphicspath` setting for flattened doc tree #1191
- Promote warning "Plot data file \`...' not found" to error
- Allow empty value for /pgf/arrow keys/fill to make it behave more like /tikz/fill #1352

### Contributors

Expand All @@ -37,6 +38,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Qrrbrbirlbel
- quark67
- Rocky Zhang (@rockyzhz)
- Romano Giannetti (@rmano)
- Yukai Chou (@muzimuzhi)
- Alexander Grahn
- Max Chernoff
Expand Down
8 changes: 6 additions & 2 deletions 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} (default \normalfont is scope's color setting)}
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,10 @@ \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 the current scope.

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 All @@ -827,7 +831,7 @@ \subsubsection{Coloring}
A shorthand for |fill=none|.
\end{key}

When you use both the |color| and |fill| option, the |color| option must
When you use both the |color| and |fill| options, the |color| option must
come first since it will reset the filling to the color specified for
drawing.
%
Expand Down
10 changes: 6 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,14 @@
fill/.code={%
\def\pgf@temp{#1}%
\ifx\pgf@temp\pgf@nonetext%
\pgfarrowsaddtooptions{\pgfarrowopentrue}
\pgfarrowsaddtooptions{\pgfarrowopentrue}%
\else\ifx\pgf@temp\pgfutil@empty%
\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,
fill/.default=,
open/.style={fill=none},
.unknown/.code={
\expandafter\pgfutil@in@\expandafter!\expandafter{\pgfkeyscurrentname}%
Expand Down

0 comments on commit ffb5f4f

Please sign in to comment.