Skip to content

Commit

Permalink
Reset \tikz@intersect@namedpaths at scope boundaries, fixes #284
Browse files Browse the repository at this point in the history
The previous commit fb5d730 introduced
a regression, because resetting the named paths at the beginning of
every \path command is too early.

Unfortunately, with this fix named paths will respect TikZ scoping but
not TeX grouping.  I'm not sure whether that is at all possible.
Clearly it would require moving away from \global macros and use
smuggling instead.
  • Loading branch information
hmenke committed Aug 28, 2019
1 parent aee5465 commit 5e2f4a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
\let\tikz@intersect@total=\pgfutil@empty

\tikzset{
every scope/.append style={
execute at begin scope={\let\tikz@intersect@namedpaths@outside\tikz@intersect@namedpaths},
execute at end scope={\global\let\tikz@intersect@namedpaths\tikz@intersect@namedpaths@outside},
},
name intersections/.code={%
\tikzset{/tikz/intersection/.cd,
by=,
Expand Down
1 change: 0 additions & 1 deletion tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,6 @@
% settings.

\def\tikz@command@path{%
\global\let\tikz@intersect@namedpaths=\pgfutil@empty% clear intersections
\let\tikz@signal@path=\tikz@signal@path% for detection at begin of matrix cell
\pgfutil@ifnextchar[{\tikz@check@earg}%]
{\pgfutil@ifnextchar<{\tikz@doopt}{\tikz@@command@path}}}%
Expand Down

0 comments on commit 5e2f4a8

Please sign in to comment.