summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty')
-rw-r--r--Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty27
1 files changed, 18 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty b/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty
index f7095d337a2..bcde183dd9a 100644
--- a/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty
+++ b/Master/texmf-dist/tex/latex/circuitikz/pgfcircmath.sty
@@ -20,15 +20,23 @@
\pgf@process{#2}%
\advance\pgf@x by-\pgf@xa%
\advance\pgf@y by-\pgf@ya%
- \ifdim\pgf@x=0pt
- \ifdim\pgf@y<0pt
- \def\pgfmathresult{-90.0}
- \else
- \def\pgfmathresult{+90.0}
- \fi
- \else
- \pgfmathdivide{\pgf@y}{\pgf@x}
- \pgfmathatan{\pgfmathresult}
+ \ifdim\pgf@x<0.0001pt
+ \ifdim\pgf@x>-0.0001pt % vertical
+ \ifdim\pgf@y<0pt
+ \def\pgfmathresult{-90.0}
+ \else
+ \def\pgfmathresult{+90.0}
+ \fi
+ \else % oblique with dx < 0
+ \pgfmathdivide{\pgf@y}{\pgf@x}
+ \pgfmathatan{\pgfmathresult}
+ \ifdim\pgf@x<0pt
+ \pgfmathsubtract{\pgfmathresult}{+180}
+ \fi
+ \fi
+ \else % oblique with dx > 0
+ \pgfmathdivide{\pgf@y}{\pgf@x}
+ \pgfmathatan{\pgfmathresult}
\ifdim\pgf@x<0pt
\pgfmathsubtract{\pgfmathresult}{+180}
\fi
@@ -40,3 +48,4 @@
}
\endinput
+