Skip to content

Commit

Permalink
fix(animations): Add missing \pgf@sys@tonumber before <dimen>
Browse files Browse the repository at this point in the history
"Private" implementations of `pgfmath` functions only accept unit-less
numbers as their arguments, e.g.,
    \pgfmathadd@{1.0}{1.0}
So every dimension used as their argument must be prefixed by a `\pgf@sys@tonumber`, e.g.,
    \pgfmathadd@{\pgf@sys@tonumber\pgf@x}{\pgf@sys@tonumber\pgf@y}

This eliminates "Missing character" reports for `p` and `t`.

Signed-off-by: muzimuzhi <muzimuzhi@gmail.com>
  • Loading branch information
muzimuzhi committed Dec 12, 2021
1 parent c8ee2d9 commit 00ef2e1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tex/generic/pgf/systemlayer/pgfsysanimations.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@
% Interval too small: Goto end of interval
\def\pgfmathresult{1.0}%
\else%
\pgfmathdivide@{\pgf@ya}{\pgf@xa}%
\pgfmathdivide@{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@xa}%
\fi%
\pgf@x\pgfmathresult pt\relax%
\expandafter\pgfsysanim@splitter\the\pgf@x%
Expand Down Expand Up @@ -926,7 +926,7 @@
% Interval too small: Goto end of interval
\def\pgfmathresult{1.0}%
\else%
\pgfmathdivide@{\pgf@ya}{\pgf@xa}%
\pgfmathdivide@{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@xa}%
\fi%
\pgf@x\pgfmathresult pt\relax%
\expandafter\pgfsysanim@splitter\the\pgf@x%
Expand Down Expand Up @@ -971,7 +971,7 @@
% Interval too small: Goto end of interval
\def\pgfmathresult{1.0}%
\else%
\pgfmathdivide@{\pgf@ya}{\pgf@xa}%
\pgfmathdivide@{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@xa}%
\fi%
\pgf@x\pgfmathresult pt\relax%
\expandafter\pgfsysanim@splitter\the\pgf@x%
Expand Down Expand Up @@ -1001,7 +1001,8 @@
% Interval too small: Goto end of interval
\def\pgfmathresult{1.0}%
\else%
\pgfmathdivide@{\pgfsysanim@snap@repeat@arg}{\pgf@xa}%
% `\pgfsysanim@snap@repeat@arg` is a macro storing a dimen value, eg "4.0pt"
\pgfmathdivide@{\pgf@sys@tonumber\dimexpr\pgfsysanim@snap@repeat@arg}{\pgf@sys@tonumber\pgf@xa}%
\fi%
\pgf@x\pgfmathresult pt\relax%
\expandafter\pgfsysanim@splitter\the\pgf@x%
Expand Down Expand Up @@ -1823,7 +1824,7 @@
\def\pgfsysanim@frac@b{1}%
\else%
\let\pgfsysanim@divby\pgfmathresult%
\pgfmathsubtract@{\pgf@xc}{\pgfsysanim@prev@time}%
\pgfmathsubtract@{\pgf@sys@tonumber\pgf@xc}{\pgfsysanim@prev@time}%
\pgfmathdivide@{\pgfmathresult}{\pgfsysanim@divby}%
\ifdim\pgfmathresult pt<0pt\def\pgfmathresult{0}\fi%
\ifdim\pgfmathresult pt>1pt\def\pgfmathresult{1}\fi%
Expand Down Expand Up @@ -1875,7 +1876,7 @@
\pgf@ya\pgfsysanim@ft%
\advance\pgf@ya by-\pgfsysanim@frac@a pt%
\pgf@yb\pgf@x
\pgfmathreciprocal@{\pgf@yb}%
\pgfmathreciprocal@{\pgf@sys@tonumber\pgf@yb}%
\ifdim\pgfmathresult pt>2.5pt%
\def\pgfmathresult{2.5}%
\fi%
Expand Down Expand Up @@ -1906,7 +1907,7 @@
\pgf@ya\pgfsysanim@ft%
\advance\pgf@ya by-\pgfsysanim@frac@a pt%
\pgf@yb\pgf@x
\pgfmathreciprocal@{\pgf@yb}%
\pgfmathreciprocal@{\pgf@sys@tonumber\pgf@yb}%
\ifdim\pgfmathresult pt>2.5pt%
\def\pgfmathresult{2.5}%
\fi%
Expand Down Expand Up @@ -1938,7 +1939,7 @@
\pgf@ya\pgfsysanim@ft%
\advance\pgf@ya by-\pgfsysanim@frac@a pt%
\pgf@yb\pgf@x
\pgfmathreciprocal@{\pgf@yb}%
\pgfmathreciprocal@{\pgf@sys@tonumber\pgf@yb}%
\ifdim\pgfmathresult pt>2.5pt%
\def\pgfmathresult{2.5}%
\fi%
Expand Down

0 comments on commit 00ef2e1

Please sign in to comment.