diff options
author | Norbert Preining <norbert@preining.info> | 2022-02-05 03:00:59 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-02-05 03:00:59 +0000 |
commit | 08ccf305ee79ab8e5ba9d1a8f3d22e74dccedd80 (patch) | |
tree | 814254dfa55b15022a4361ba4e12cccdcdac1f2a /macros/latex/contrib/animate/animate.sty | |
parent | b7a48c5e229d2c195b6a32bfd73a1036a31f2df3 (diff) |
CTAN sync 202202050300
Diffstat (limited to 'macros/latex/contrib/animate/animate.sty')
-rw-r--r-- | macros/latex/contrib/animate/animate.sty | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/macros/latex/contrib/animate/animate.sty b/macros/latex/contrib/animate/animate.sty index 9a4fed2374..c18e4f3657 100644 --- a/macros/latex/contrib/animate/animate.sty +++ b/macros/latex/contrib/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% } |