diff options
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex')
-rw-r--r-- | graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex index 819da5a110..6634531c2c 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircvoltage.tex @@ -191,6 +191,13 @@ \def\pgf@circ@bipole@voltage@label@anchor{center} \pgfmathsetlength{\absvshift}{\absvshift+sign(\absvshift)*height{"Q"}} % with the current font. \fi + % apply the same shift to open "straight" voltage as raised + \ifpgf@circuit@bipole@voltage@straight + \ifx\@@kind\@@open + \def\pgf@circ@bipole@voltage@label@anchor{center} + \pgfmathsetlength{\absvshift}{\absvshift+sign(\absvshift)*height{"Q"}} % with the current font. + \fi + \fi } % %\pgf@circ@Rlen/\ctikzvalof{current arrow scale} is equal to the length of the currarrow %absolute move, minimum space is length of arrowhead @@ -359,6 +366,8 @@ % %>>> %% Output routine for voltage sources%<<< +% (ugly) workaround for https://github.com/circuitikz/circuitikz/issues/747 +\ctikzset{voltage shift sources adjust/.initial=0.5} % coefficient added "by feel". Sorry. \def\pgf@circ@drawvoltagegenerator{ % the following is affected indirectly by voltage/shift, you can move the arrow with voltage/bump a. % it's not perfect, but I can't find the way to do it correctly... @@ -382,7 +391,7 @@ { \edef\addvshift{0} } - \pgfmathsetmacro{\bumpaplus}{\bumpa + 0.5*\shiftv} % coefficient added "by feel". Sorry. + \pgfmathsetmacro{\bumpaplus}{\bumpa + \ctikzvalof{voltage shift sources adjust}*\shiftv} } \ifpgf@circuit@bipole@voltage@below coordinate (pgfcirc@Vfrom0) at ($(\ctikzvalof{bipole/name}.center) ! \bumpaplus ! (\ctikzvalof{bipole/name}.-120)$) |