I want to frame a set of nodes with the option [fit] and change the overall size of the drawing with [scale = xx, transform shape] but I have unexpected behavior. the frame is no longer valid
the code:
\documentclass[a4paper]{article}
\usepackage{pgf,tikz}
\usetikzlibrary{fit,calc,positioning}
\begin{document}
\begin{tikzpicture}
\node[draw](A){A};
\node[right=3em of A,draw](B){B};
\node[left=3em of A,draw](C){C};
\node[above=3em of A,draw](D){D};
\node[below=3em of A,draw](E){E};
\node[fit=(A) (B) (C) (D) (E), draw]{};
\end{tikzpicture}
\hfill
\begin{tikzpicture}[scale=0.8,transform shape]
\node[draw](A){A};
\node[right=3em of A,draw](B){B};
\node[left=3em of A,draw](C){C};
\node[above=3em of A,draw](D){D};
\node[below=3em of A,draw](E){E};
\node[fit=(A) (B) (C) (D) (E), draw]{};
\end{tikzpicture}
\end{document}
what can I do?, is this a bug?
Best Answer
You have to exclude the fitting node to be scaled since it first fits the contents and then applies the scaling to it again. Easiest is to turn off the
transfrom shape
effect.