summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-04-07 21:21:35 +0000
committerKarl Berry <karl@freefriends.org>2019-04-07 21:21:35 +0000
commitd71a23f77ba5aa8ad94858efe8080b2cc100bb25 (patch)
tree40b59b167bfa17b10adb5a738a32b0262986016a /Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty
parent1f825a1d4a63908fb04cf83a3f531201d2023847 (diff)
tikzlings (7apr19)
git-svn-id: svn://tug.org/texlive/trunk@50841 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty23
1 files changed, 17 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty
index bca27c6d9cb..206a2918956 100644
--- a/Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty
+++ b/Master/texmf-dist/tex/latex/tikzlings/tikzlings-koalas.sty
@@ -12,12 +12,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-koalas}
- [2018/11/09 v0.1 Drawing koalas in TikZ]
+ [2019/04/07 v0.2 Drawing koalas in TikZ]
\RequirePackage{tikz}
\RequirePackage{tikzlings-addons}
@@ -72,6 +72,17 @@
\path (-0.88,0.1) rectangle (0.88, 2.35);
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% 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
@@ -115,7 +126,7 @@
\koala@part@draw[\koala@body] (0,1.67) ellipse (0.55 and 0.45);
%
% Nose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\koala@part@draw[\koala@body!40!black] (-0.15, 1.57) to [out=-110,in=180] (0, 1.42) to[out=0,in=-70] (0.15, 1.57) to [out=110,in=-45] (0.075, 1.71) to[out=135,in=45] (-0.075, 1.71) to[out=-135,in=70] cycle;
+\koala@part@draw[\koala@body!40!black] (-0.1501, 1.5609) .. controls (-0.1784, 1.4833) and (-0.0827, 1.4108) .. ( 0.0000, 1.4108) .. controls ( 0.0827, 1.4108) and ( 0.1784, 1.4833) .. ( 0.1501, 1.5609) .. controls ( 0.1290, 1.6191) and ( 0.1187, 1.6573) .. ( 0.0750, 1.7010) .. controls ( 0.0336, 1.7424) and (-0.0336, 1.7424) .. (-0.0750, 1.7010) .. controls (-0.1187, 1.6573) and (-0.1290, 1.6191) .. (-0.1501, 1.5609) -- cycle;
%
% Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifkoala@sleeping
@@ -140,9 +151,9 @@
%
% Mouth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifkoala@threeD
- \fill[black] (0.115, 1.39) arc [start angle=-40, end angle=-140, radius=0.16] -- (-0.1, 1.39) -- (-0.1, 1.39) arc [start angle=-130, end angle=-50, radius=0.144] -- cycle;
+ \draw[black,line width=\scalingfactor*0.4pt] (0.115, 1.39) arc [start angle=-40, end angle=-140, radius=0.16];
\else
- \fill[\koala@body!40!black] (0.115, 1.39) arc [start angle=-40, end angle=-140, radius=0.16] -- (-0.1, 1.39) -- (-0.1, 1.39) arc [start angle=-130, end angle=-50, radius=0.144] -- cycle;
+ \draw[\koala@body!40!black,line width=\scalingfactor*0.4pt] (0.115, 1.39) arc [start angle=-40, end angle=-140, radius=0.16];
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%