How to set shape's size from another shape
I would like to set shape's size basing on the size of another shape
produced by the fit environment. The MWE I use is the following:
\documentclass{report}
\usepackage[english]{babel}
\usepackage{tikz}
\usetikzlibrary{positioning, fit}
\tikzset{
node distance = 1.5cm,
block/.style = {
text width = 3cm,
minimum height = 2cm,
draw = blue!80,
fill = blue!20
},
module/.style = {
draw = black!50,
fill = yellow!20,
inner sep = 10pt
}
}
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\begin{document}
\begin{tikzpicture}
\node[block] (B1) {B1};
\node[block, right = of B1] (B2) {B2};
\begin{pgfonlayer}{background}
\node[module, fit = (B1) (B2)] (F) { };
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
What I want is to add one more yellow shape below with the exact size of
shape F:
No comments:
Post a Comment