diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex index 568caa1f64a..127c2975df5 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex @@ -1,7 +1,7 @@ -% Copyright 2018-2022 by Romano Giannetti -% Copyright 2015-2022 by Stefan Lindner -% Copyright 2013-2022 by Stefan Erhardt -% Copyright 2007-2022 by Massimo Redaelli +% Copyright 2018-2023 by Romano Giannetti +% Copyright 2015-2023 by Stefan Lindner +% Copyright 2013-2023 by Stefan Erhardt +% Copyright 2007-2023 by Massimo Redaelli % % This file may be distributed and/or modified % @@ -1065,12 +1065,30 @@ } %% converters help function +%% definition for styling the DC symbols (GitHub issue #680) +\ctikzset{blocks dc in segments/.initial=1} +\ctikzset{blocks dc out segments/.initial=1} +\ctikzset{blocks dc segments/.code={% + \ctikzset{blocks dc in segments=#1}% + \ctikzset{blocks dc out segments=#1}% + } +} \def\pgf@circ@twoport@converter@dc#1#2{% \pgfscope \pgftransformshift{\pgfpoint{#1\pgf@circ@res@step}{#2\pgf@circ@res@step}} \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0.125\pgf@circ@res@step}} \pgfpathlineto{\pgfpoint{0.25\pgf@circ@res@step}{0.125\pgf@circ@res@step}} \pgfusepath{draw} + \ifpgf@circuit@full@dashed\else % do not apply the specific dash if fully dashing + \edef\@@up{\ctikzvalof{blocks dc in segments}} + \edef\@@down{\ctikzvalof{blocks dc out segments}} + \ifdim\dimexpr#1\pgf@circ@res@step\relax<0pt + \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@res@step/(4*\@@up-2)} + \else + \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@res@step/(4*\@@down-2)} + \fi + \pgfsetdash{{\pgf@circ@res@other}{\pgf@circ@res@other}}{0pt} + \fi \pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{-0.125\pgf@circ@res@step}} \pgfpathlineto{\pgfpoint{0.25\pgf@circ@res@step}{-0.125\pgf@circ@res@step}} \pgfusepath{draw} |