This code:
\pic[rotate=40, local bounding box=microfono] at (4.5,-5) {microph};
\draw[black, line width=2pt] (microfono.-45) -- ++(-.2,+.2) ++(.2,-.2) -- ++(0,-2);
works outside the scope
but not inside (the line is not displayed). Why?
\documentclass[border=0pt]{standalone}
\usepackage{tikz}
\tikzset{
pics/microph/.style={code={
\draw[black, line width=.2em, rounded corners=1.7ex]
(-.85em,4.5ex) -- (-.85em,2ex) -- (.85em,2ex) -- (.85em,4.5ex);
\fill[black]
(-.6em,5ex) to[rounded corners=1.2ex]
(-.6em,2.5ex) to[rounded corners=1.2ex] (.6em,2.5ex)
-- (.6em,5ex) to[rounded corners=.2ex] ++(-.85em,0) to[rounded corners=.2ex] ++(0,.35ex) -- ++(.85em,0)
-- (.6em,5.5ex) to[rounded corners=.2ex] ++(-.85em,0) to[rounded corners=.2ex] ++(0,.35ex) -- ++(.85em,0)
-- (.6em,6ex) to[rounded corners=.2ex] ++(-.85em,0) to[rounded corners=.2ex] ++(0,.35ex) -- ++(.85em,0)
-- (.6em,6.5ex) to[rounded corners=.2ex] ++(-.85em,0) to[rounded corners=.2ex] ++(0,.35ex) -- ++(.85em,0)
to[rounded corners=1.2ex]
(.6em,8ex) to[rounded corners=1.2ex]
(-.6em,8ex) to cycle;
}},
}
\begin{document}
\begin{tikzpicture}
\begin{scope}
\clip (-8.5,-6.5) rectangle (8.5,6.5);
\node[fill=cyan, draw=cyan, minimum width=17cm, minimum height=13cm](sky){};
\pic[rotate=40, local bounding box=microfono] at (4.5,-5) {microph};
\draw[black, line width=2pt] (microfono.-45) -- ++(-.2,+.2) ++(.2,-.2) -- ++(0,-2);
\end{scope}
\end{tikzpicture}
\end{document}
\clip (-8.5,-6.5) rectangle (8.5,6.5);
\path (4.5,-5) pic[rotate=40, pic type=microph] node(microfono){};
, but I don't understant why the original code don't work.