In a beamer presentation I am using tikz to draw graphs. To highlight part of the graph I am using overlay and the fit library as in the following MWE:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{positioning,fit}
\begin{document}
\begin{frame}
\frametitle{TEST}
\centering
\begin{tikzpicture}
\node[draw=black, rectangle] (a) {A};
\node[draw=black, rectangle, right=of a] (b) {B};
\draw (a) -- (b);
\node<2>[draw=red, line width=1.5pt, fit=(a) (b)]{};
\end{tikzpicture}
\begin{itemize}
\item A
\item B
\end{itemize}
\end{frame}
\end{document}
This solution works fine, excepted that there is a little shift of the whole frame when the user click the mouse to reveal the higliht rectangle drawn with fit. I guess that this comes from the fact that addiding this fit node changes the bounds of the tikzpicture. How can I remove this annoying shift behaviour ?
\node<1>[draw=white, line width=1.5pt, fit=(a) (b)]{};
into your tikzpicture above the\node<2>...
line... I'm sure there is a better way, so I won't put this as an answer :-)opacity=0
it doesn't hide anything in the background.