Commit 47a54c25 authored by Camil Staps's avatar Camil Staps 🚀

Fix alignment of block marks on east of head when arity=0

parent 91c8aa7b
Pipeline #17542 passed with stage
in 4 minutes and 46 seconds
......@@ -90,15 +90,18 @@
anchor=mid,
every block,
},
block/.append code={\let\arg\memorygraphs@arg},
block/.append code={%
\let\arg\memorygraphs@arg%
\gdef\memorygraphs@arity{0}%
},
block mark north east/.style={
append after command={
\pgfextra
\pgfinterruptpath
\draw[#1]
($(\tikzlastnode.head north east)-(0,.5\pgflinewidth)$)
($(\tikzlastnode.head north east)-(\ifnum\memorygraphs@arity=0 .5\pgflinewidth\else0\fi,.5\pgflinewidth)$)
-- +(0,-\memorygraphs@marklength)
-- ($(\tikzlastnode.head north east)-(0+\memorygraphs@marklength,.5\pgflinewidth)$)
-- ($(\tikzlastnode.head north east)-(\ifnum\memorygraphs@arity=0 .5\pgflinewidth\else0\fi+\memorygraphs@marklength,.5\pgflinewidth)$)
-- cycle;
\endpgfinterruptpath
\endpgfextra
......@@ -109,9 +112,9 @@
\pgfextra
\pgfinterruptpath
\draw[#1]
($(\tikzlastnode.head south east)+(0,.5\pgflinewidth)$)
($(\tikzlastnode.head south east)+(\ifnum\memorygraphs@arity=0 -.5\pgflinewidth\else0\fi,.5\pgflinewidth)$)
-- +(0,\memorygraphs@marklength)
-- ($(\tikzlastnode.head south east)+(0-\memorygraphs@marklength,.5\pgflinewidth)$)
-- ($(\tikzlastnode.head south east)+(\ifnum\memorygraphs@arity=0 -.5\pgflinewidth\else0\fi-\memorygraphs@marklength,.5\pgflinewidth)$)
-- cycle;
\endpgfinterruptpath
\endpgfextra
......@@ -151,6 +154,11 @@
rectangle split every empty part={},
rectangle split empty part width=.2em,
},
arity/.append code={%
\pgfmathsetcount\c@pgf@counta{\pgfkeysvalueof{/pgf/rectangle split parts}}%
\ifnum\c@pgf@counta=0\else\advance\c@pgf@counta by-1 \fi
\xdef\memorygraphs@arity{\the\c@pgf@counta}%
},
ref/.style={
{Circle[length=3pt]}-Latex,
shorten <=-1.5pt,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment