Skip to content

Commit

Permalink
\pgfmatrix: Optimize out \pgf@matrix@column@sep@N.
Browse files Browse the repository at this point in the history
Simplify code to handle column separation in pgf matrices:
change \pgf@picminx only once per matrix cell for this purpose.

Signed-off-by: Gábor Braun <gabor.braun@uni-duisburg-essen.de>
  • Loading branch information
gabor-braun committed Dec 3, 2021
1 parent c1b6711 commit 6887d3f
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions tex/generic/pgf/modules/pgfmodulematrix.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,10 @@
\advance\pgf@x by -\pgf@xa%
\fi%
\advance\pgfmatrixcurrentcolumn by1\relax % only temporary for the following:
\expandafter\xdef\csname pgf@matrix@column@sep@\the\pgfmatrixcurrentcolumn\endcsname{\the\pgf@x}%
\ifpgf@matrix@fixed%
\expandafter\gdef\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname{\global\pgf@picminx=0pt}%
\else%
\expandafter\global\expandafter\let\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname=\pgfutil@empty%
\fi%
\expandafter\xdef\csname pgf@matrix@column@finish@%
\the\pgfmatrixcurrentcolumn\endcsname%
{\global\ifpgf@matrix@fixed\else\advance\fi%
\pgf@picminx -\the\pgf@x}%
}%
\fi%
&%
Expand All @@ -416,17 +414,13 @@
\global\pgf@picmaxy=0pt\relax%
\global\pgf@picminy=0pt\relax%
\fi%
%
% Step 5: Row and column separation
%
\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname%
\pgf@matrix@row@finish%
\egroup\egroup%
%
% Step 5: Horizontal gap
%
\ifnum\pgfmatrixcurrentcolumn>1\relax%
\pgf@y=\csname pgf@matrix@column@sep@\the\pgfmatrixcurrentcolumn\endcsname\relax%
\advance\pgf@picminx by-\pgf@y%
\fi%
%
% Step 6: Protocol and adjust height and depth
%
% Step 6.1: Protocol...
Expand Down

0 comments on commit 6887d3f

Please sign in to comment.