# TikZ fading doesn't move with scope

There's almost certainly something I'm missing here but I'd like a faded drawing to be defined and placed at various points in the picture. I can get it to look how I want, but when I place it in \begin{scope}[xshift=\x,yshift=\y] environment, the fading doesn't move with the rest of what's in the scope.

Here's a stripped-down example:

\documentclass{article}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{calc,decorations.pathmorphing,shapes}

\def\flame{
\path(0,0) pic{flame};
}
\tikzset{%
flame/.pic={
code={
\tikzset{scale=1/10}
\node[circle,minimum height=4, minimum width=4, fill=\fillcolour,inner sep=0,outer sep=0] at(0,-1){};

}}}

\begin{document}

\begin{tikzpicture}
\fill[black] (-4,-3) rectangle (6,4);

\node[circle,inner sep=0, outer sep=0, draw=white,very thin] at (0,0){};

\begin{scope}[xshift=0cm, yshift=-0cm]
\def\fillcolour{yellow}
\flame
\end{scope}

\begin{scope}[xshift=.1cm, yshift=-0.1cm]
\def\fillcolour{cyan}
\flame
\end{scope}
\end{tikzpicture}
\end{document}


The white circle just indicates the origin. The yellow shaded circle looks right; when I shift it the fading stays behind (as seen from the cyan shaded circle).

• It seems you have to give all transformations to \pgfsetfading. – Symbol 1 Jan 6 '17 at 15:42
• @Symbol1 which implies a rewrite to draw a faded item at a particular location, rather than draw and move it. I'll have a try later on – Chris H Jan 6 '17 at 15:51
• I just proposed an answer. This is by no means the only approach. You can try. – Symbol 1 Jan 6 '17 at 15:52

You may redefine \frame as follows

\def\flame{
\pgfgettransform{\mycurrenttransform}

Here, \pgfgettransform will store the current transformation in \mycurrenttransform and \pgfsettransform will restore it in \pgfsetfading. That is, it now remembers where you are.