Skip to content

[Bug] Full body diodes not really filled when their color is changed #794

@Rmano

Description

@Rmano

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}

image

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}

image

...but I have to think a bit about it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions