-
Notifications
You must be signed in to change notification settings - Fork 115
Open
Labels
Description
Brief outline of the bug
It seems that when using a scope with on background layer, the clipping areas leak to other on background layer scopes unless it is protected by another scope.
I am not sure if this is expected behavior or not.
Minimal working example (MWE)
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}[]
\draw (0,0) rectangle (1,1);
\begin{scope}[on background layer]
\begin{scope}
\clip (0,0) rectangle (1,1);
\filldraw[yellow] (0,0) circle[radius=1cm];
\end{scope}
\end{scope}
\begin{scope}[on background layer]
\begin{scope}
\clip (-1,-1) rectangle (1,1);
\filldraw[orange] (0,0) circle[radius=.2cm];
\end{scope}
\end{scope}
\end{tikzpicture}
\end{document}results in
with correct clipping, but if you comment out the inner scope environments, you get:
In both, I am a bit surprised by the bounding box, though.