-
Notifications
You must be signed in to change notification settings - Fork 70
Closed
Labels
Description
There seems to be a problem when changing the color of full bodydiodes... (problem spotted answering to this question)
\documentclass[border=2.78mm]{standalone}
\usepackage[americanvoltages]{circuitikz}
\usepackage{xpatch}
\begin{document}
\begin{tikzpicture}
\draw[full diodes]
(0,0) to[Do] ++(0,-1.25)
node[nigfete,bodydiode, anchor=D,
circuitikz/transistor bodydiode/color=red](){}
(2,0) to[D-] ++(0,-1.25)
node[nigfete,bodydiode,stroke diodes, anchor=D,
circuitikz/transistor bodydiode/color=red](){}
(4,0) to[D*] ++(0,-1.25)
node[nigfete,bodydiode,tr circle,anchor=D,
circuitikz/transistor bodydiode/color=red](){}
;
\end{tikzpicture}
\end{document}
This seems to be fixable by:
\documentclass[border=2.78mm]{standalone}
\usepackage[americanvoltages]{circuitikz}
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\drawbodydiode}{%
\pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
}{%
\pgf@circ@maybe@color{transistor bodydiode/color}
\pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
}{}{\error}
\makeatother
\begin{document}
\begin{tikzpicture}
\draw[full diodes]
(0,0) to[Do] ++(0,-1.25)
node[nigfete,bodydiode, anchor=D,
circuitikz/transistor bodydiode/color=red](){}
(2,0) to[D-] ++(0,-1.25)
node[nigfete,bodydiode,stroke diodes, anchor=D,
circuitikz/transistor bodydiode/color=red](){}
(4,0) to[D*] ++(0,-1.25)
node[nigfete,bodydiode,tr circle,anchor=D,
circuitikz/transistor bodydiode/color=red](){}
;
\end{tikzpicture}
\end{document}
...but I have to think a bit about it.