From 5e2f4a884cc0886fbce3f063f5b6705dfff37a89 Mon Sep 17 00:00:00 2001 From: Henri Menke Date: Wed, 28 Aug 2019 09:52:07 +1200 Subject: [PATCH] Reset \tikz@intersect@namedpaths at scope boundaries, fixes #284 The previous commit fb5d73081d836faa200dec9a46dadf6f93926e79 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. --- .../tikz/libraries/tikzlibraryintersections.code.tex | 4 ++++ tex/generic/pgf/frontendlayer/tikz/tikz.code.tex | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex b/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex index 5b0e83d5e..f7ff81b7e 100644 --- a/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex +++ b/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryintersections.code.tex @@ -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=, diff --git a/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex b/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex index e65535e62..110f4a1db 100644 --- a/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex +++ b/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex @@ -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}}}%