In the following MWE:
\documentclass{beamer}
\setbeamertemplate{footline}[page number]
\usepackage{tikz}
\usetikzlibrary{spy,shadows,decorations.fractals}
\begin{document}
\begin{frame}
\begin{tikzpicture}
[spy scope={magnification=4, size=1cm},
every spy in node/.style={%
drop shadow,
fill=white,
draw,
}]
\draw [decoration=Koch curve type 2]
decorate{ decorate{ decorate{ (0,0) -- (2,0) }}};
\only<2>{\spy on (0,0) in node;}
\end{tikzpicture}
\end{frame}
\end{document}
the main tikz picture on the 2nd frame is right shifted because of the \spy node, the size of which being non zero.
But I'd like the main picture to stay static, even if the \spy node partially vanishes in the left margin.
I guess this could be done by making the \spy node's size null in order it is not taken in account. How could I achieve such a result?



\spy"always", but invisible when not wanted. Thereby thetikzpicturealways keeps the same size. Look at this answer for a general solution. – Daniel Sep 09 '16 at 22:00