Skip to content

Commit 5b96b3f

Browse files
committed
new accessories: present
1 parent 8de373b commit 5b96b3f

3 files changed

Lines changed: 34 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
### New
66

7+
- new accessories: present (many thanks to @CarLaTeX)
8+
79
### Changed
810

911
### Fixed

tikzlings-addons.sty

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
\thing@ini[acces]{handbag}
125125
\thing@ini[acces]{stick}
126126
\thing@ini[acces]{towel}
127+
\thing@ini[acces]{present}
127128

128129
\tikzset{%
129130
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -137,7 +138,7 @@
137138
randomhead/.code = \shufflethings,
138139
randomhead/.forward to = /thing/\randomhead,
139140
randomaccessories/.code = \shufflethings,
140-
randomaccessories/.forward to = /thing/\randomaccessories,
141+
randomaccessories/.forward to = /thing/\randomaccessories,
141142
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
142143
%
143144
% Hats
@@ -373,6 +374,18 @@
373374
towel/.code = \thing@toweltrue
374375
\def\thing@towel{#1},
375376
towel/.default = violet,
377+
present/.code = \thing@presenttrue
378+
\def\thing@present{#1},
379+
present/.default = violet,
380+
presenttop/.code = \def\thing@presenttop{#1},
381+
presenttop = \thing@present!70,
382+
present top/.forward to = /thing/presenttop,
383+
presentbottom/.code = \def\thing@presentbottom{#1},
384+
presentbottom = \thing@present!80,
385+
present bottom/.forward to = /thing/presentbottom,
386+
presentribbon/.code = \def\thing@presentribbon{#1},
387+
presentribbon = \thing@present,
388+
present ribbon/.forward to = /thing/presentribbon,
376389
}
377390

378391
\def\thing@draw{%
@@ -945,6 +958,16 @@
945958
\end{scope}
946959
\fi
947960
%
961+
% present %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
962+
\ifthing@present
963+
\fill[\thing@presentbottom] (-0.3, 0.35) rectangle (0.3, 0.9);
964+
\fill[\thing@presenttop] (-0.32, 0.75) rectangle (0.32, 0.95);
965+
\fill[\thing@presentribbon] (-0.05, 0.35) rectangle (0.05, 0.95);
966+
\draw[\thing@presentribbon,line width=\scalingfactor*0.8pt, in=0, out=40,loop,min distance=12] (0, 0.95) to (0, 0.95);
967+
\draw[\thing@presentribbon,line width=\scalingfactor*0.8pt, in=40, out=80,loop,min distance=12] (0, 0.95) to (0, 0.95);
968+
\draw[\thing@presentribbon,line width=\scalingfactor*0.8pt,in=100, out=140,loop,min distance=12] (0, 0.95) to (0, 0.95);
969+
\draw[\thing@presentribbon,line width=\scalingfactor*0.8pt,in=140, out=180,loop,min distance=12] (0, 0.95) to (0, 0.95);
970+
\fi
948971
}
949972

950973
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

tikzlings-doc.tex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,14 @@ \subsection{Other items}
735735
]
736736
\end{tcblisting}
737737

738+
\begin{tcblisting}{title={Present}}
739+
\dog[present=violet]
740+
\dog[present, xshift=2cm,
741+
present top=cyan,
742+
present bottom=blue,
743+
present ribbon=teal]
744+
\end{tcblisting}
745+
738746
\subsection{Random accessories}
739747

740748
Given the number of available accessories, it can be hard to decide which ones to use.

0 commit comments

Comments
 (0)