diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/animate/animate.sty | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty index cedd442a724..ff05e49d9c1 100644 --- a/Master/texmf-dist/tex/latex/animate/animate.sty +++ b/Master/texmf-dist/tex/latex/animate/animate.sty @@ -13,7 +13,7 @@ \NeedsTeXFormat{LaTeX2e}[2020-10-01] -\def\@anim@version{2021/11/09} +\def\@anim@version{2022/01/21} \ProvidesPackage{animate} [\@anim@version\space PDF & SVG animations from files and inline graphics] @@ -203,8 +203,8 @@ \def\ocgbase@add@to@off@list#1{% \xdef\@anim@curocg{\@anim@curocg\space visibility='hidden'}% } - \def\ocgbase@oc@bdc#1{\special{dvisvgm:raw {?nl}<g #1>}} - \def\ocgbase@oc@emc{\special{dvisvgm:raw {?nl}</g>}} + \def\ocgbase@oc@bdc#1{\special{dvisvgm:raw <g #1>}} + \def\ocgbase@oc@emc{\special{dvisvgm:raw </g>}} \else \ExplSyntaxOn \def\@anim@dictobj#1{ @@ -476,11 +476,32 @@ \def\@anim@makeframe#1#2{% %container box \edef\@anim@tmpvar{\@anim@getkeyval{frmcontent@#2},}% - \global\setbox\@anim@box=\hbox to \@anim@animwidth{% - \vrule width \z@ height \@anim@animheight depth \@anim@animdepth% - \expandafter\@anim@insertfrmcontent\@anim@tmpvar\@nil% - \hss% - }% + \if@anim@dvisvgm% + \global\setbox\@anim@box=\hbox to \@anim@animwidth{% + \raise\@anim@animheight\hbox{% + \special{dvisvgm:raw + <g transform="translate({?x},{?y})"><svg overflow="hidden" + width="\strip@pt\dimexpr0.996264\dimexpr\@anim@animwidth" + height="\strip@pt\dimexpr0.996264\dimexpr\@anim@animtotalheight" + viewBox="% + {?x} + {?(y-\strip@pt\dimexpr0.996264\dimexpr\@anim@animheight)} + {?(\strip@pt\dimexpr0.996264\dimexpr\@anim@animwidth)} + {?(\strip@pt\dimexpr0.996264\dimexpr\@anim@animtotalheight)}% + ">% + }% + \vrule width \z@ height \@anim@animheight depth \@anim@animdepth% + \expandafter\@anim@insertfrmcontent\@anim@tmpvar\@nil% + \special{dvisvgm:raw </svg></g>}% + }\hss% + }% + \else% + \global\setbox\@anim@box=\hbox to \@anim@animwidth{% + \vrule width \z@ height \@anim@animheight depth \@anim@animdepth% + \expandafter\@anim@insertfrmcontent\@anim@tmpvar\@nil% + \hss% + }% + \fi% %inside a `landscape' environment together with the icon and widget methods, %the frame content needs to be rotated counter-clockwise by 90 deg \ifnum\@anim@method>\@ne\else% @@ -1531,7 +1552,7 @@ \fi% \@anim@reset% to default settings \if@anim@dvisvgm% - \special{dvisvgm:raw{?nl}% + \special{dvisvgm:raw <!-- animation by LaTeX-package `animate', https://ctan.org/tex-archive/macros/latex/contrib/animate, v. \@anim@version\space-->% @@ -1566,8 +1587,6 @@ \ifx\@anim@gropts\@empty\else,\fi\@anim@trim}\fi% \ifx\@anim@angle\@empty\else\xdef\@anim@gropts{\@anim@gropts% \ifx\@anim@gropts\@empty\else,\fi\@anim@angle}\fi% - \if@anim@clip\xdef\@anim@gropts{\@anim@gropts% - \ifx\@anim@gropts\@empty\else,\fi clip}\fi% \if@anim@hiresbb\xdef\@anim@gropts{\@anim@gropts% \ifx\@anim@gropts\@empty\else,\fi hiresbb}\fi% \if@anim@interpolate\xdef\@anim@gropts{\@anim@gropts% @@ -2057,7 +2076,7 @@ \if@anim@export\else\leavevmode\fi% \@anim@reset% to default settings \if@anim@dvisvgm% - \special{dvisvgm:raw{?nl}% + \special{dvisvgm:raw <!-- animation by LaTeX-package `animate', https://ctan.org/tex-archive/macros/latex/contrib/animate, v. \@anim@version\space-->% @@ -2845,9 +2864,8 @@ \define@key{anim@user}{angle}{% \xdef\@anim@angle{angle=#1}% } -\newboolean{@anim@clip} -\define@key{anim@usr}{clip}[true]{% - \setboolean{@anim@clip}{#1}% +\define@key{anim@user}{clip}[true]{% + %no-op, as embedded graphics are always clipped to widget box } \newboolean{@anim@hiresbb} \define@key{anim@user}{hiresbb}[true]{% @@ -3158,7 +3176,6 @@ \global\let\@anim@viewport\@anim@@viewport% \global\let\@anim@trim\@anim@@trim% \global\let\@anim@angle\@anim@@angle% - \global\let\if@anim@clip=\if@anim@@clip% \global\let\if@anim@hiresbb=\if@anim@@hiresbb% \global\let\if@anim@interpolate=\if@anim@@interpolate% \global\let\@anim@pagebox\@anim@@pagebox% @@ -3376,9 +3393,8 @@ \define@key{anim@pkg}{angle}{% \xdef\@anim@@angle{angle=#1}% } -\newboolean{@anim@@clip} \define@key{anim@pkg}{clip}[true]{% - \setboolean{@anim@@clip}{#1}% + %no-op, as embedded graphics are always clipped to widget box } \newboolean{@anim@@hiresbb} \define@key{anim@pkg}{hiresbb}[true]{% |