texlive[41770] Master/texmf-dist: animate (28jul16)

commits+karl at tug.org commits+karl at tug.org
Sun Jul 31 01:09:29 CEST 2016


Revision: 41770
          http://tug.org/svn/texlive?view=revision&revision=41770
Author:   karl
Date:     2016-07-31 01:09:29 +0200 (Sun, 31 Jul 2016)
Log Message:
-----------
animate (28jul16)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/animate/ChangeLog
    trunk/Master/texmf-dist/doc/latex/animate/README
    trunk/Master/texmf-dist/doc/latex/animate/animate.pdf
    trunk/Master/texmf-dist/source/latex/animate/animate.tex
    trunk/Master/texmf-dist/tex/latex/animate/animate.sty

Modified: trunk/Master/texmf-dist/doc/latex/animate/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/doc/latex/animate/ChangeLog	2016-07-30 23:09:09 UTC (rev 41769)
+++ trunk/Master/texmf-dist/doc/latex/animate/ChangeLog	2016-07-30 23:09:29 UTC (rev 41770)
@@ -1,3 +1,11 @@
+2016-07-27
+	* new: `method=icon' default setting for dvips+ps2pdf; support for
+	Foxit Reader (besides Acrobat Reader and PDF-XChange Viewer) added
+
+2016-07-25
+	* fix: timeline JavaScript of the displayed poster frame not executed
+	while loading the animation for the first time
+
 2016-06-08
 	* new: reverse playback direction with shift + mouse click
 

Modified: trunk/Master/texmf-dist/doc/latex/animate/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/animate/README	2016-07-30 23:09:09 UTC (rev 41769)
+++ trunk/Master/texmf-dist/doc/latex/animate/README	2016-07-30 23:09:29 UTC (rev 41770)
@@ -17,8 +17,8 @@
     It supports the usual PDF making workflows, i. e.  pdfLaTeX, LaTeX -> dvips
     -> ps2pdf (Ghostscript)/Distiller and (Xe)LaTeX -> (x)dvipdfmx.
 
-    The resulting PDF can be viewed in current Adobe Readers on supported
-    platforms (except mobile devices).
+    The resulting PDF with animations can be viewed in Acrobat Reader (except on
+    mobile devices), in PDF-XChange Viewer and in Foxit Reader.
 
     Note, this file only gives a summary of usage and available package and
     command options. Please refer to the documentation `animate.pdf' for details
@@ -27,7 +27,7 @@
     Keywords: include portable PDF animated PDF animation animating
     embed animated graphics LaTeX pdfLaTeX PSTricks pgf TikZ MetaPost
     LaTeX-picture inline graphics vector graphics animated GIF LaTeX
-    dvips ps2pdf dvipdfmx XeLaTeX JavaScript Adobe Reader
+    dvips ps2pdf dvipdfmx XeLaTeX JavaScript Acrobat Reader
 
 
 Usage:
@@ -77,7 +77,7 @@
     pdfTeX, version >= 1.20
     Ghostscript, version >= 9.15 or Adobe Distiller
     dvipdfmx, version >= 20080607
-    Adobe Reader, version >= 7
+    Acrobat Reader (version >= 7), PDF-XChange Viewer, Foxit Reader
 
 
 Installation:

Modified: trunk/Master/texmf-dist/doc/latex/animate/animate.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/animate/animate.tex
===================================================================
--- trunk/Master/texmf-dist/source/latex/animate/animate.tex	2016-07-30 23:09:09 UTC (rev 41769)
+++ trunk/Master/texmf-dist/source/latex/animate/animate.tex	2016-07-30 23:09:29 UTC (rev 41770)
@@ -12,7 +12,8 @@
 \usepackage{pst-3dplot}
 \usepackage{pst-node,pst-plot,pst-tools,pst-text,pst-ode}
 \usepackage{media9}
-\usepackage[buttonbg=0.9]{animate}
+%\usepackage[buttonbg=0.9]{animate}
+\usepackage[buttonbg=0.9,method=widget]{animate}
 \usepackage{intcalc}
 \usepackage{graphicx}
 \graphicspath{{files/}}
@@ -54,7 +55,7 @@
   \makeatother
 \fi
 
-\def\keywords{include portable PDF animation animated PDF animating embed animated graphics LaTeX pdfLaTeX LuaLaTeX PSTricks pgf TikZ LaTeX-picture MetaPost inline graphics vector graphics animated GIF LaTeX dvips ps2pdf dvipdfmx XeLaTeX JavaScript Adobe Reader PDF-XChange Viewer}
+\def\keywords{include portable PDF animation animated PDF animating embed animated graphics LaTeX pdfLaTeX LuaLaTeX PSTricks pgf TikZ LaTeX-picture MetaPost inline graphics vector graphics animated GIF LaTeX dvips ps2pdf dvipdfmx XeLaTeX JavaScript Acrobat Reader PDF-XChange Viewer Foxit Reader}
 \hypersetup{
   pdftitle={The animate Package},
   pdfsubject={Documentation},
@@ -90,7 +91,7 @@
 \def\@anim at sanitizeColon{}\def\@anim at sanitizeJS{}\def\@anim at endsanitize{}
 \expandafter\parsedate\@anim at version\relax %set current date to package date
 \makeatother
-\author{Alexander Grahn \animategraphics[autoplay,loop,height=1.8ex,nomouse]{8}{bye_}{0}{3}\protect\footnote{Animated GIF taken from \href{http://www.phpBB.com}{phpBB} forum software and burst into a set of EPS files using \href{http://www.imagemagick.org}{ImageMagick} before embedding.} \protect\footnote{Animations may run slowly if viewed in the Adobe Reader browser plugin.}\\[1ex]\includegraphics[height=2.7ex]{mailto}}
+\author{Alexander Grahn \animategraphics[autoplay,loop,height=1.8ex,nomouse]{8}{bye_}{0}{3}\protect\footnote{Animated GIF taken from \href{http://www.phpBB.com}{phpBB} forum software and burst into a set of EPS files using \href{http://www.imagemagick.org}{ImageMagick} before embedding.} \protect\footnote{Animations may run slowly if viewed in the Acrobat Reader browser plugin.}\\[1ex]\includegraphics[height=2.7ex]{mailto}}
 \maketitle
 \endgroup
 \begin{abstract}
@@ -112,7 +113,7 @@
 
 Package `animate' supports the usual PDF making workflows, i.\,e. pdf\LaTeX{}, Lua\LaTeX{}, \LaTeX{} $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+/Distiller and \pXepLaTeX{} $\rightarrow$ \verb+(x)dvipdfmx+.
 
-The final PDF can be viewed in current Adobe Readers on all supported platforms (except mobile devices) or in PDF-XChange Viewer.
+PDF files with animations can be viewed in Acrobat Reader (except on mobile devices), in PDF-XChange Viewer (with option `\verb+method=widget+' or `\verb+method=ocg+') and in Foxit Reader.
 
 \section{Requirements}
 \begin{trivlist}
@@ -120,7 +121,7 @@
 \item pdf\TeX{}, version $\ge1.20$ or Lua\TeX{} for direct PDF output
 \item Ghostscript, version $\ge9.15$ or Adobe Distiller for PS to PDF conversion
 \item dvipdfmx, version $\ge20080607$ for DVI to PDF conversion
-\item Adobe Reader, version $\ge7$ or PDF-XChange Viewer (with option `\verb+method=widget+' or `\verb+method=ocg+')
+\item Acrobat Reader (version $\ge7$), PDF-XChange Viewer, Foxit Reader
 \end{trivlist}
 
 \section{Installation}
@@ -316,7 +317,7 @@
 \begin{verbatim}
 method=icon | widget | ocg
 \end{verbatim}
-The package implements three different animation methods. The `\verb+icon+' method is the default one for the pdf\LaTeX, \XeLaTeX{} and \verb+dvipdfmx+ workflows, and `\verb+widget+` for the \verb+dvips+ route. The `\verb+icon+' method usually gives the best animation performance (achievable frame rate). Forcing `\verb+icon+' in the case of \verb+dvips+ unfortunately leads to dead `hyperref'-inserted links in the final PDF; it should be enabled only if the `hyperref' package is \emph{not} used. This is for technical reasons, more specifically, due to a limitation of the `\verb+pdfmark+' Postscript operator. The `\verb+ocg+' method is an alternative animation method based on Optional Content Groups (OCGs, also known as PDF Layers). In rare cases (standalone animations without animation controls) it may lead to better animation performance than the other two methods. Moreover, it allows overlaying animations with other typeset material, that is, playing animations in the page background.
+The package implements three different animation methods. The `\verb+icon+' method is the default method and usually gives the best performance in terms of animation frame rate. `\verb+widget+' and `\verb+ocg+' are alternative animation methods. In rare cases (standalone animations without animation controls) method `\verb+ocg+' may lead to a better animation performance than the other two. Moreover, it allows overlaying animations with other typeset material, that is, playing animations in the page background.
 \begin{verbatim}
 measure
 \end{verbatim}
@@ -1264,18 +1265,16 @@
 
 \section{Bugs}\label{sect:bugs}
 \begin{itemize}
-  \item The maximum frame rate that can actually be achieved largely depends on the complexity of the graphics and on the available hardware. Starting with version 8, Adobe Reader appears to be somewhat slower. However, you might want to experiment with the graphical hardware acceleration feature that was introduced in Reader 8. Go to menu `Edit' $\rightarrow$ `Preferences' $\rightarrow$ `Page Display' $\rightarrow$ `Rendering' to see whether hardware acceleration is available. A 2D GPU acceleration check box will be visible if a supported video card has been detected.
+  \item The maximum frame rate that can actually be achieved largely depends on the complexity of the graphics and on the available hardware. Starting with version 8, Acrobat Reader appears to be somewhat slower. However, you might want to experiment with the graphical hardware acceleration feature that was introduced in Reader 8. Go to menu `Edit' $\rightarrow$ `Preferences' $\rightarrow$ `Page Display' $\rightarrow$ `Rendering' to see whether hardware acceleration is available. A 2D GPU acceleration check box will be visible if a supported video card has been detected.
 
-  \item Animations may run very slowly if viewed in the Adobe Reader web-browser plugin. Instead, open the PDF locally in the Reader application for best results.
+  \item Animations may run very slowly if viewed in the Acrobat Reader web-browser plugin. Instead, open the PDF locally in the Reader application for best results.
 
-  \item The Adobe Reader setting `Use page cache' (menu `Edit' $\rightarrow$ `Preferences' $\rightarrow$ `Startup') should be \emph{dis}abled for version 7, while remaining \emph{en}abled beginning with version 8 (menu `Edit' $\rightarrow$ `Preferences' $\rightarrow$ `Page Display' $\rightarrow$ `Rendering').
+  \item The Acrobat Reader setting `Use page cache' (menu `Edit' $\rightarrow$ `Preferences' $\rightarrow$ `Startup') should be \emph{dis}abled for version 7, while remaining \emph{en}abled beginning with version 8 (menu `Edit' $\rightarrow$ `Preferences' $\rightarrow$ `Page Display' $\rightarrow$ `Rendering').
 
-  \item The \verb+dvips+ option `\verb+-Ppdf+' should be avoided entirely or followed by something like `\verb+-D 1200+' on the command line in order to set a sensible DVI resolution. This does \emph{not} degrade the output quality! The configuration file `config.pdf' loaded by option `\verb+-Ppdf+' specifies an excessively high DVI resolution that will be passed on to the final PDF. Eventually, Adobe Reader gets confused and will not display the frames within the animation widget.
+  \item The \verb+dvips+ option `\verb+-Ppdf+' should be avoided entirely or followed by something like `\verb+-D 1200+' on the command line in order to set a sensible DVI resolution. This does \emph{not} degrade the output quality! The configuration file `config.pdf' loaded by option `\verb+-Ppdf+' specifies an excessively high DVI resolution that will be passed on to the final PDF. Eventually, Acrobat Reader gets confused and will not display the frames within the animation widget.
 
   \item Animations do not work if the PDF was produced with Ghostscript versions older than 9.15.
 
-  \item The default animation method (`{\tt icon}') is not supported in PDF-XChange Viewer. Use one of `{\tt method=widget}' or `{\tt method=ocg}' instead.
-
   \item If the \LaTeX{} $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+/Distiller route is being taken, make sure that the original graphics size (i.\,e. not scaled by any of the `{\tt scale}', `{\tt width}', `{\tt height}' or `{\tt totalheight}' options) does not exceed the page size of the final document. During PS to PDF conversion every graphic of the animation is temporarily moved to the upper left page corner. Those parts of the graphics that do not fit onto the document page will be clipped in the resulting PDF. Fortunately, graphics files for building animations may be resized easily to fit into a given bounding box by means of the `{\tt epsffit}' command line tool:
 
 \quad{\tt epsffit -c <llx> <lly> <urx> <ury> infile.eps outfile.eps}

Modified: trunk/Master/texmf-dist/tex/latex/animate/animate.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/animate/animate.sty	2016-07-30 23:09:09 UTC (rev 41769)
+++ trunk/Master/texmf-dist/tex/latex/animate/animate.sty	2016-07-30 23:09:29 UTC (rev 41770)
@@ -13,7 +13,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 
-\def\@anim at version{2016/06/08}
+\def\@anim at version{2016/07/27}
 \ProvidesPackage{animate}
 [\@anim at version\space PDF animations from files and inline graphics]
 
@@ -103,7 +103,10 @@
 
   \def\@anim at pdfannot#1#2#3#4{
     \pbs_pdfannot:nnnn{#1}{#2}{#3}{#4}
-    %since all annots are Widgets
+  }
+
+  \def\@anim at pdfwid#1#2#3#4{
+    \pbs_pdfannot:nnnn{#1}{#2}{#3}{#4}
     \pbs_appendtofields:n{\pbs_pdflastann:}
   }
 
@@ -236,35 +239,6 @@
   \@ifpackageloaded{graphicx}{\setboolean{@anim at grxloaded}{true}}{}%
 }
 
-%add Appearances name tree to /Names dict of the PDF Catalog
-\def\@anim at appearances{}
-\ifpdf
-  \AtEndDvi{%
-    \ifx\empty\@anim at appearances\empty\else%
-      \@anim at arrayobj{\@anim at appearances}%
-      \pdfnames{/AP<</Names \@anim at lastobj>>}%
-    \fi%
-  }%
-\else
-  \if at anim@dvipdfmx
-    \AtEndDvi{%
-      \ifx\empty\@anim at appearances\empty\else%
-        \@anim at arrayobj{\@anim at appearances}%
-        \special{pdf:put @names <</AP<</Names \@anim at lastobj>>>>}%
-      \fi%
-    }%
-  \else
-    \AtEndDvi{%
-      \ifx\empty\@anim at appearances\empty\else%
-        \@anim at arrayobj{\@anim at appearances}%
-        \PackageWarningNoLine{animate}{\@anim at icondvipswarning}%
-        %this deletes hyperref-inserted Dests!
-        \@anim at pdfcatalog{/Names<</AP<</Names \@anim at lastobj>>>>}%
-      \fi%
-    }%
-  \fi
-\fi
-
 % true if any of `autoplay' or `autoresume' options is set
 \newboolean{@anim at autoplayorresume}
 % true if any of `controls' or `palindrome' or `label' options is set
@@ -471,10 +445,15 @@
         \fi%
       \fi%
     \fi%
-    %build appearance name tree
-    \xdef\@anim at appearances{%
-      \@anim at appearances
-      (\@anim at pad{1234}{#1}.\@anim at pad{1234}{#2}) \@anim at lastxform%
+    %insert (invisible) widget with current frame as appearance
+    \@anim at pdfwid{\@anim at animwidth}{\@anim at animheight}{\@anim at animdepth}{%
+      /Subtype/Widget%
+      /F 2%
+      /FT/Btn/Ff 65537%
+      /BS <</W 0>>%
+      /AP <</N \@anim at lastxform>>%
+      /MK <</TP 1/I \@anim at lastxform/IF<</S/A/FB true>>>>%
+      /T (#1.#2)%
     }%
   \or% widget based
     %initial visibility
@@ -495,7 +474,7 @@
     \fi%
     %frame insertion
     \@anim at xform{0}{1}{\@anim at box}%
-    \@anim at pdfannot{\@anim at animwidth}{\@anim at animheight}{\@anim at animdepth}{%
+    \@anim at pdfwid{\@anim at animwidth}{\@anim at animheight}{\@anim at animdepth}{%
       /Subtype/Widget%
       \@anim at annotflag%
       /FT/Btn/Ff 65537%
@@ -1552,13 +1531,18 @@
   \ifnum\@anim at method=\z@\relax%
     \def\@anim at annotflag{/F 4}% 4=allow printing
     \ifnum\@anim at poster=\@anim at mtwo\relax%
-      \ifdefined\@anim at apdummy\else% empty appearance dummy
+      \ifdefined\@anim at apdummy\else% empty appearance widget
         \setbox\@anim at box=\hbox{\phantom{x}}%
         \@anim at xform{0}{0}{\@anim at box}%
         \xdef\@anim at apdummy{\@anim at lastxform}%
-        \xdef\@anim at appearances{%
-          (0000) \@anim at lastxform
-          \@anim at appearances%
+        \@anim at pdfwid{1ex}{1ex}{\z@}{%
+          /Subtype/Widget%
+          /F 2%
+          /FT/Btn/Ff 65537%
+          /BS <</W 0>>%
+          /AP <</N \@anim at lastxform>>%
+          /MK <</TP 1/I \@anim at lastxform/IF<</S/A/FB true>>>>%
+          /T (0000)%
         }%
       \fi%
       \def\@anim at apmk{\@anim at apdummy}%
@@ -1573,6 +1557,18 @@
     \fi%
     \def\@anim at apmk{\@anim at apdummy}%
   \fi%
+  %non-interactive /Screen annotation for initializing the animation
+  %upon PageOpen/PageVisible events and for clean-up upon PageClose/
+  %PageInvisible events
+  \@anim at pdfannot{1ex}{1ex}{\z@}{%
+    /Subtype/Screen/F 2%
+    /AA <<%
+      /PV <</S/JavaScript/JS \@anim at pojscriptobj>>% PageVisible
+      /PO <</S/JavaScript/JS \@anim at pojscriptobj>>% PageOpen
+      /PI <</S/JavaScript/JS \@anim at pcjscriptobj>>% PageInvisible
+      /PC <</S/JavaScript/JS \@anim at pcjscriptobj>>% PageClose
+    >>%
+  }%
   %With icon and ocg method, we put one dummy widget below; this seems to be
   %necessary for the OCG visibility referenced by the /OC entry to work as
   %expected (if we place the animation on a PDF layer using ocgx2.sty).
@@ -1579,13 +1575,13 @@
   \ifnum\@anim at method=\@ne\relax\else%
     \ifdefined\ocgxii at insert@OC%
       \ifthenelse{\equal{\ocgxii at insert@OC}{}}{}{%
-        \@anim at pdfannot{\@anim at animwidth}{\@anim at animheight}{\@anim at animdepth}{%
+        \@anim at pdfwid{\@anim at animwidth}{\@anim at animheight}{\@anim at animdepth}{%
           /Subtype/Widget/F 2%
         }%
       }%
     \fi%
   \fi%
-  \@anim at pdfannot{\@anim at animwidth}{\@anim at animheight}{\@anim at animdepth}{%
+  \@anim at pdfwid{\@anim at animwidth}{\@anim at animheight}{\@anim at animdepth}{%
     /Subtype/Widget%
     /FT/Btn/Ff \@anim at btnflag%
     \@anim at annotflag%
@@ -1594,10 +1590,6 @@
     /T (anm#1)%
     /Contents (animation by animate[\@anim at version])%
     /AA <<%
-      /PV <</S/JavaScript/JS \@anim at pojscriptobj>>% PageVisible
-      /PO <</S/JavaScript/JS \@anim at pojscriptobj>>% PageOpen
-      /PI <</S/JavaScript/JS \@anim at pcjscriptobj>>% PageInvisible
-      /PC <</S/JavaScript/JS \@anim at pcjscriptobj>>% PageClose
       \@anim at otherjscriptkey%
     >>%
     /AP <</N \@anim at apmk>>%
@@ -1639,12 +1631,12 @@
   \setlength{\@anim at tmpdima}{\@anim at btnsize}%
   \ifdefined\ocgxii at insert@OC% put dummy widget below (for ocgx2 compatibility)
     \ifthenelse{\equal{\ocgxii at insert@OC}{}}{}{%
-      \@anim at pdfannot{\@anim at tmpdima}{\@anim at tmpdima}{\z@}{%
+      \@anim at pdfwid{\@anim at tmpdima}{\@anim at tmpdima}{\z@}{%
         /Subtype/Widget/F 2%
       }%
     }%
   \fi%
-  \@anim at pdfannot{\@anim at tmpdima}{\@anim at tmpdima}{\z@}{%
+  \@anim at pdfwid{\@anim at tmpdima}{\@anim at tmpdima}{\z@}{%
     /Subtype/Widget%
     \@anim at annotflag%
     /FT/Btn/Ff \if at anim@js 65536\else 65537\fi%
@@ -2920,11 +2912,8 @@
   }{}%
 }
 
-%default animation method is Icon based, except for dvips
+%default animation method is Icon based
 \def\@anim@@method{\z@}
-\ifpdf\else\if at anim@dvipdfmx\else % dvips, by default, uses Widget based method
-  \def\@anim@@method{\@ne}
-\fi\fi
 
 %process package options
 \def\@anim at setpkgkeys#1{\setkeys{anim at pkg}{#1}}
@@ -2949,20 +2938,13 @@
     a#1.fr=new Array();%
     %initialize fr properties
     \ifcase\@anim at method %icon based
-      var spc=String.fromCharCode(32);%
-      if(typeof this.getIcon==='undefined'){%
-        app.alert('Icon-based'+spc+'animation'+spc+'is'+spc+'not'+spc+%
-          'supported'+spc+'by'+spc+'this'+spc+'Reader.'+spc+'Try'+spc+%
-          'one'+spc+'of'+spc+'"method=widget"'+spc+'or'+spc+%
-          '"method=ocg"'+spc+'options.');%
-      }%
       a#1.wid=this.getField('anm#1');%reference to interactive widget
       for(i=0;i<=\@anim at maxframe;i++){%
-        a#1.fr[i]=this.getIcon(util.printf('\@anim at pad{1234}{#1}.\%04d',i));%
+        a#1.fr[i]=this.getField('#1.'+i).buttonGetIcon();%
       }%
       \ifnum\@anim at poster=\@anim at mtwo
         if(typeof blnk==='undefined'){% blank poster
-          blnk=this.getIcon('0000');%
+          blnk=this.getField('0000').buttonGetIcon();%
         }%
       \fi%
     \or %widget based
@@ -3007,9 +2989,9 @@
         %arrays that take frame numbers (array index) and fps values
         a#1.nFpsAt=new Array(\@anim at nfpsat);%
       \fi
-      a#1.fps=\@anim at fps;a#1.sm=1;%
+      a#1.fps=\@anim at fps==0?1e-6:\@anim at fps;a#1.sm=1;%
       a#1.setFps=function(f){%
-        a#1.fps=f;%
+        a#1.fps=f==0?1e-6:f;%
         if(a#1.playing){%
           if(a#1.playsRight){a#1.playRight();}else{a#1.playLeft();}%
         }%
@@ -3168,7 +3150,11 @@
         \fi%
       };%
       a#1.playRight=function(){%
+        \if at anim@meas a#1.startMeas();\fi
+        try{var tmp_int=app.setInterval('a#1.gotoNext()',%
+          1000/a#1.fps/a#1.sm);}catch(e){}%
         try{app.clearInterval(a#1_int);}catch(e){}%
+        a#1_int=tmp_int;%
         a#1.playsRight=true;%
         a#1.playing=true;%
         a#1.isPaused=false;%
@@ -3179,12 +3165,13 @@
           a#1.btnPlayRight.display=display.hidden;%
           curdoc.dirty=false;%
         \fi%
-        \if at anim@meas a#1.startMeas();\fi
-        a#1_int=app.setInterval('a#1.gotoNext()',%
-          1000/(1e-6+a#1.fps)/a#1.sm);%
       };%
       a#1.playLeft=function(){%
+        \if at anim@meas a#1.startMeas();\fi
+        try{var tmp_int=app.setInterval('a#1.gotoPrev()',%
+          1000/a#1.fps/a#1.sm);}catch(e){}%
         try{app.clearInterval(a#1_int);}catch(e){}%
+        a#1_int=tmp_int;%
         a#1.playsRight=false;%
         a#1.playing=true;%
         a#1.isPaused=false;%
@@ -3195,9 +3182,6 @@
           a#1.btnPlayRight.display=display.hidden;%
           curdoc.dirty=false;%
         \fi%
-        \if at anim@meas a#1.startMeas();\fi
-        a#1_int=app.setInterval('a#1.gotoPrev()',%
-        1000/(1e-6+a#1.fps)/a#1.sm);%
       };%
       \if at anim@controls
         a#1.fpsIncr=function(){% speed up animation
@@ -3274,7 +3258,7 @@
                 throw new RangeError('Frame_rate_not_in_allowed_range');%
               }else{a#1.setFps(f);}%
             },%
-            get dt(){return 1000/(1e-6+a#1.fps)/a#1.sm;},%
+            get dt(){return 1000/a#1.fps/a#1.sm;},%
             get playsFwd(){return a#1.playsRight;},%
           \fi
           get numFrames(){return \@anim at frames;},%
@@ -3298,14 +3282,15 @@
         };%
       }%
     \fi%
+    \ifnum\@anim at method>\z@ a#1.on=0;\fi% just initialize a#1.on
     \ifnum\@anim at poster=\@anim at mtwo %poster=none
-      a#1.idx=-1;\ifnum\@anim at method>\z@ a#1.on=0;\fi%
+      var ret=app.setTimeOut('a#1.seekFrame(-2)',1);%
     \fi%
     \ifnum\@anim at poster>\@anim at mone %poster=<num>|first
-      a#1.idx=\ifnum\@anim at method>\z@ a#1.on=\fi\@anim at poster;%
+      var ret=app.setTimeOut('a#1.seekFrame(\@anim at poster)',1);%
     \fi%
     \ifnum\@anim at poster=\@anim at mone %poster=last
-      a#1.idx=\ifnum\@anim at method>\z@ a#1.on=\fi\@anim at maxframe;%
+      var ret=app.setTimeOut('a#1.seekFrame(\@anim at maxframe)',1);%
     \fi%
   }%
   \if at anim@step\else%



More information about the tex-live-commits mailing list