From d71a23f77ba5aa8ad94858efe8080b2cc100bb25 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 7 Apr 2019 21:21:35 +0000 Subject: tikzlings (7apr19) git-svn-id: svn://tug.org/texlive/trunk@50841 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/tikzlings/tikzlings-moles.sty | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-moles.sty') diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-moles.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-moles.sty index 228385a129b..b59e022fd57 100644 --- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-moles.sty +++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-moles.sty @@ -11,12 +11,12 @@ % Released under the LaTeX Project Public License v1.3c or later % See http://www.latex-project.org/lppl.txt % -% Version 0.1 -% Nov 9, 2018 +% Version 0.2 +% April 7, 2019 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ProvidesPackage{tikzlings-moles} - [2018/11/09 v0.1 Drawing moles in TikZ] + [2019/04/07 v0.2 Drawing moles in TikZ] \RequirePackage{tikz} \RequirePackage{tikzlings-addons} @@ -69,6 +69,17 @@ \path (-0.625,0.1) rectangle (0.905, 2.17); % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% store the current scale factor +% from https://github.com/samcarter/tikzlings/issues/3#issuecomment-461373494 +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\pgfgettransformentries{\tmpscaleA}{\tmpscaleB}{\tmpscaleC}{\tmpscaleD}{\tmp}{\tmp}% +\pgfmathsetmacro{\scalingfactor}{sqrt(abs(\tmpscaleA*\tmpscaleD-\tmpscaleB*\tmpscaleC))}% +\pgfmathsetmacro{\xscalefactor}{\tmpscaleA} +\pgfmathsetmacro{\yscalefactor}{\tmpscaleD} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % switch between 2D and 3D, from % https://chat.stackexchange.com/transcript/message/45991801#45991801 @@ -128,6 +139,6 @@ \fi % % Mouth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\fill[\mole@body!60!black] (0.145,1.51) arc [start angle=-20, end angle=-160, radius=0.16] -- (-0.14,1.51) -- (-0.14,1.51) arc [start angle=-160, end angle=-20, radius=0.144] -- cycle ; +\draw[\mole@body!60!black, line width=\scalingfactor*0.4pt] (0.145,1.51) arc [start angle=-20, end angle=-160, radius=0.16] ; % } \ No newline at end of file -- cgit v1.2.3