diff options
author | Karl Berry <karl@freefriends.org> | 2022-02-04 22:19:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-02-04 22:19:45 +0000 |
commit | e084623aa9a5bb986ff83a5dadd0acef0ef3a306 (patch) | |
tree | 9ad1fc28acc5f776ab93f2b021864ddf7a30bf57 /Master/texmf-dist/tex/latex/animate | |
parent | 04a585df0c1efc659651ea6535edbb43558c83ca (diff) |
animate (4feb22)
git-svn-id: svn://tug.org/texlive/trunk@61875 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/animate')
-rw-r--r-- | Master/texmf-dist/tex/latex/animate/animate.sty | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty index 9a4fed23749..c18e4f3657b 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{2022/01/31} +\def\@anim@version{2022/02/04} \ProvidesPackage{animate} [\@anim@version\space PDF & SVG animations from files and inline graphics] @@ -411,12 +411,7 @@ \ifdim\@anim@curdp=\@anim@animdepth\else\def\@anim@needresize{1}\fi% % resize content to final dimensions, if necessary \ifnum\@anim@needresize>\z@\relax% - \setbox#3=\hbox{% - \raisebox{-\@anim@animdepth}{% - \resizebox*{\@anim@animwidth}{% - \@anim@animtotalheight}{\raisebox{\depth}{\box#3}}% - }% - }% + \setbox#3=\hbox{\resizebox{\@anim@animwidth}{\@anim@animheight}{\box#3}}% \fi% \ifthenelse{\equal{#4}{newfile}\OR\equal{#4}{inline}}{% \@anim@xform{1}{1}{}{}{#3}% @@ -488,6 +483,11 @@ \if@anim@export% \setboolean{@anim@singleref}{false}\def\@anim@framexform{}% \fi% + % ... also, for method=ocg, we prefer packing content in an xform, as it allows + % higher frame rates + \ifnum\@anim@method=\tw@\if@anim@dvisvgm\else% + \setboolean{@anim@singleref}{false}\def\@anim@framexform{}% + \fi\fi% \if@anim@singleref\else% % put frame content in a box if necessary \setbox\@anim@box=\hbox to \@anim@animwidth{% @@ -501,13 +501,12 @@ \setbox\@anim@box=\hbox{\rotatebox{90}{\box\@anim@box}}% \fi% \fi% - % convert it to an xform - \if@anim@export\else% + \fi% + \ifcase\@anim@method% icon based + \if@anim@singleref\else% \@anim@xform{0}{1}{}{}{\@anim@box}% \let\@anim@framexform\@anim@lastxform% \fi% - \fi% - \ifcase\@anim@method% icon based %initial visibility \ifnum\@anim@poster>\@anim@mtwo\relax% insert poster frame \ifnum#2=\@anim@poster\relax% @@ -547,6 +546,10 @@ \fi% \fi% %frame insertion + \if@anim@singleref\else% + \@anim@xform{0}{1}{}{}{\@anim@box}% + \let\@anim@framexform\@anim@lastxform% + \fi% \@anim@widget{\@anim@animwidth}{\@anim@animheight}{\@anim@animdepth}{% /Subtype/Widget% \@anim@annotflag% @@ -579,9 +582,21 @@ \fi% \fi% %frame insertion - \ocgbase@oc@bdc{\@anim@curocg}% - \@anim@refxform{\@anim@framexform}% - \ocgbase@oc@emc% + \if@anim@dvisvgm% + \if@anim@singleref\else% + \@anim@xform{0}{1}{}{}{\@anim@box}% + \let\@anim@framexform\@anim@lastxform% + \fi% + % `marked content' method for dvisvgm + \ocgbase@oc@bdc{\@anim@curocg}% + \@anim@refxform{\@anim@framexform}% + \ocgbase@oc@emc% + \else% + % /OC method for PDF output, higher frame rates than + % with marked content (BDC/EMC) + \@anim@xform{0}{1}{}{/OC \@anim@curocg}{\@anim@box}% + \@anim@refxform{\@anim@lastxform}% + \fi% \fi% \fi% } |