Skip to content

Commit

Permalink
Protect parens and order of operations in turtle #789
Browse files Browse the repository at this point in the history
  • Loading branch information
hmenke committed Nov 25, 2019
1 parent 319cae0 commit 41a8555
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
% given, by turtle distance
\tikzset{
turtle/forward/.default=\pgfkeysvalueof{/tikz/turtle/distance},
turtle/forward/.style={/tikz/insert path={to[/tikz/turtle/how]++(\tikz@lib@turtle@dir:#1)}}
turtle/forward/.style={/tikz/insert path={to[/tikz/turtle/how]++({\tikz@lib@turtle@dir}:{#1})}}
}%


Expand All @@ -46,7 +46,7 @@
\tikzset{
turtle/left/.default=90,
turtle/left/.code={%
\pgfmathparse{#1+\tikz@lib@turtle@dir}%
\pgfmathparse{(#1)+(\tikz@lib@turtle@dir)}%
\ifdim\pgfmathresult pt>360pt\relax%
\pgfmathparse{\pgfmathresult-360}%
\fi%
Expand All @@ -60,7 +60,7 @@
turtle/right/.default=90,
turtle/right/.code={%
\pgfmathparse{#1}
\pgfmathparse{\tikz@lib@turtle@dir-\pgfmathresult}%
\pgfmathparse{(\tikz@lib@turtle@dir)-\pgfmathresult}%
\ifdim\pgfmathresult pt<0pt\relax%
\pgfmathparse{\pgfmathresult+360}%
\fi%
Expand Down

0 comments on commit 41a8555

Please sign in to comment.