Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow empty value for /pgf/arrow keys/fill #1352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems consistency beats no more unnecessary % ...

\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
Loading