texlive[61683] Master/texmf-dist: animate (21jan22)

commits+karl at tug.org commits+karl at tug.org
Fri Jan 21 23:48:27 CET 2022


Revision: 61683
          http://tug.org/svn/texlive?view=revision&revision=61683
Author:   karl
Date:     2022-01-21 23:48:27 +0100 (Fri, 21 Jan 2022)
Log Message:
-----------
animate (21jan22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/animate/ChangeLog
    trunk/Master/texmf-dist/doc/latex/animate/README.txt
    trunk/Master/texmf-dist/doc/latex/animate/animate.pdf
    trunk/Master/texmf-dist/source/latex/animate/animate.tex
    trunk/Master/texmf-dist/source/latex/animate/files/scarab.mp
    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	2022-01-21 22:47:31 UTC (rev 61682)
+++ trunk/Master/texmf-dist/doc/latex/animate/ChangeLog	2022-01-21 22:48:27 UTC (rev 61683)
@@ -1,3 +1,6 @@
+2022-01-21
+	* fix: clipping for dvisvgm
+
 2021-11-09
 	* improvement: play from beginning, regardless of poster frame setting
 

Modified: trunk/Master/texmf-dist/doc/latex/animate/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/animate/README.txt	2022-01-21 22:47:31 UTC (rev 61682)
+++ trunk/Master/texmf-dist/doc/latex/animate/README.txt	2022-01-21 22:48:27 UTC (rev 61683)
@@ -48,7 +48,7 @@
    bb=<llx> <lly> <urx> <ury>,
    viewport=<llx> <lly> <urx> <ury>,
    trim=<left> <bottom> <right> <top>,
-   clip, hiresbb, pagebox=..., interpolate,
+   hiresbb, pagebox=..., interpolate,
    type=[<file ext>],
    final, draft, nomouse,
    autopause, autoplay, autoresume,
@@ -86,7 +86,7 @@
    bb=<llx> <lly> <urx> <ury>,
    viewport=<llx> <lly> <urx> <ury>,
    trim=<left> <bottom> <right> <top>,
-   clip, hiresbb, pagebox=..., interpolate,
+   hiresbb, pagebox=..., interpolate,
    type=[<file ext>],
    final, draft, nomouse,
    autopause, autoplay, autoresume,

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	2022-01-21 22:47:31 UTC (rev 61682)
+++ trunk/Master/texmf-dist/source/latex/animate/animate.tex	2022-01-21 22:48:27 UTC (rev 61683)
@@ -174,7 +174,6 @@
 bb=<llx> <lly> <urx> <ury>
 viewport=<llx> <lly> <urx> <ury>
 trim=<left> <bottom> <right> <top>
-clip
 hiresbb
 interpolate
 pagebox=...
@@ -348,11 +347,11 @@
 trim=<left> <bottom> <right> <top>
 \end{verbatim}
 (\verb+\animategraphics+ only.) Crops graphic at the edges. The four lengths specify the amount to be removed from or, if negative values have been provided, to be added to each side of the graphic.
+%\begin{verbatim}
+%clip
+%\end{verbatim}
+%(\verb+\animategraphics+ only.) Clips the graphic to the (possibly modified) bounding box.
 \begin{verbatim}
-clip
-\end{verbatim}
-(\verb+\animategraphics+ only.) Clips the graphic to the (possibly modified) bounding box.
-\begin{verbatim}
 pagebox=...
 hiresbb
 interpolate

Modified: trunk/Master/texmf-dist/source/latex/animate/files/scarab.mp
===================================================================
--- trunk/Master/texmf-dist/source/latex/animate/files/scarab.mp	2022-01-21 22:47:31 UTC (rev 61682)
+++ trunk/Master/texmf-dist/source/latex/animate/files/scarab.mp	2022-01-21 22:48:27 UTC (rev 61683)
@@ -1,5 +1,5 @@
 % Maxime Chupin, Alexander Grahn
-% 2021/04/08
+% 2022/01/21
 
 prologues:=3;
 outputtemplate := "%j_%c.mps";
@@ -75,16 +75,12 @@
     endfor;
   fi;
   beginfig(i) %red scarabaeus segments
-    setbounds currentpicture to
-    (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle;
     pickup pencircle scaled 1pt;
     draw scara withcolor red;
-    clip currentpicture to
+    setbounds currentpicture to
     (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle;
   endfig;
   beginfig(i+101) %moving construction lines and labels
-    setbounds currentpicture to
-    (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle;
     draw 12[P,Q]--12[Q,P] dashed evenly;
     draw O--M dashed evenly;
     pickup pencircle scaled 1.4pt;
@@ -93,16 +89,14 @@
     dotlabel.urt(btex $P$ etex, P);
     dotlabel.llft(btex $Q$ etex,Q);
     dotlabel.top(btex $M$ etex,M);
-    clip currentpicture to
+    setbounds currentpicture to
     (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle;
   endfig;
   if (i/2.-floor(i/2.))=0: %gray lines every second image
     beginfig(i/2+202)
+      draw P--Q withcolor 0.8 white;
       setbounds currentpicture to
       (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle;
-      draw P--Q withcolor 0.8 white;
-      clip currentpicture to
-      (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle;
     endfig;
   fi;
 endfor;
@@ -109,8 +103,6 @@
 
 %coordinate axes and stationary stuff
 beginfig(253);
-  setbounds currentpicture to
-  (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle;
   path ida,mida;
   drawarrow(-1.5u,0)--(1u,0);
   drawarrow(0,-1.2u)--(0,1.2u);
@@ -129,7 +121,7 @@
   dotlabel.rt(btex $B$ etex,B);
   dotlabel.lft(btex $C$ etex,C);
   dotlabel.lft(btex $D$ etex,D);
-  clip currentpicture to
+  setbounds currentpicture to
   (u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle;
 endfig;
 

Modified: trunk/Master/texmf-dist/tex/latex/animate/animate.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/animate/animate.sty	2022-01-21 22:47:31 UTC (rev 61682)
+++ trunk/Master/texmf-dist/tex/latex/animate/animate.sty	2022-01-21 22:48:27 UTC (rev 61683)
@@ -13,7 +13,7 @@
 
 \NeedsTeXFormat{LaTeX2e}[2020-10-01]
 
-\def\@anim at version{2021/11/09}
+\def\@anim at version{2022/01/21}
 \ProvidesPackage{animate}
 [\@anim at version\space PDF & SVG animations from files and inline graphics]
 
@@ -203,8 +203,8 @@
   \def\ocgbase at add@to at off@list#1{%
     \xdef\@anim at curocg{\@anim at curocg\space visibility='hidden'}%
   }
-  \def\ocgbase at oc@bdc#1{\special{dvisvgm:raw {?nl}<g #1>}}
-  \def\ocgbase at oc@emc{\special{dvisvgm:raw {?nl}</g>}}
+  \def\ocgbase at oc@bdc#1{\special{dvisvgm:raw <g #1>}}
+  \def\ocgbase at oc@emc{\special{dvisvgm:raw </g>}}
 \else
   \ExplSyntaxOn
   \def\@anim at dictobj#1{
@@ -476,11 +476,32 @@
 \def\@anim at makeframe#1#2{%
   %container box
   \edef\@anim at tmpvar{\@anim at getkeyval{frmcontent@#2},}%
-  \global\setbox\@anim at box=\hbox to \@anim at animwidth{%
-    \vrule width \z@ height \@anim at animheight depth \@anim at animdepth%
-    \expandafter\@anim at insertfrmcontent\@anim at tmpvar\@nil%
-    \hss%
-  }%
+  \if at anim@dvisvgm%
+    \global\setbox\@anim at box=\hbox to \@anim at animwidth{%
+      \raise\@anim at animheight\hbox{%
+        \special{dvisvgm:raw
+          <g transform="translate({?x},{?y})"><svg overflow="hidden"
+            width="\strip at pt\dimexpr0.996264\dimexpr\@anim at animwidth"
+            height="\strip at pt\dimexpr0.996264\dimexpr\@anim at animtotalheight"
+            viewBox="%
+              {?x}
+              {?(y-\strip at pt\dimexpr0.996264\dimexpr\@anim at animheight)}
+              {?(\strip at pt\dimexpr0.996264\dimexpr\@anim at animwidth)}
+              {?(\strip at pt\dimexpr0.996264\dimexpr\@anim at animtotalheight)}%
+            ">%
+        }%
+        \vrule width \z@ height \@anim at animheight depth \@anim at animdepth%
+        \expandafter\@anim at insertfrmcontent\@anim at tmpvar\@nil%
+        \special{dvisvgm:raw </svg></g>}%
+      }\hss%
+    }%
+  \else%
+    \global\setbox\@anim at box=\hbox to \@anim at animwidth{%
+      \vrule width \z@ height \@anim at animheight depth \@anim at animdepth%
+      \expandafter\@anim at insertfrmcontent\@anim at 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 at method>\@ne\else%
@@ -1531,7 +1552,7 @@
   \fi%
   \@anim at reset% to default settings
   \if at 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 at version\space-->%
@@ -1566,8 +1587,6 @@
     \ifx\@anim at gropts\@empty\else,\fi\@anim at trim}\fi%
   \ifx\@anim at angle\@empty\else\xdef\@anim at gropts{\@anim at gropts%
     \ifx\@anim at gropts\@empty\else,\fi\@anim at angle}\fi%
-  \if at anim@clip\xdef\@anim at gropts{\@anim at gropts%
-    \ifx\@anim at gropts\@empty\else,\fi clip}\fi%
   \if at anim@hiresbb\xdef\@anim at gropts{\@anim at gropts%
     \ifx\@anim at gropts\@empty\else,\fi hiresbb}\fi%
   \if at anim@interpolate\xdef\@anim at gropts{\@anim at gropts%
@@ -2057,7 +2076,7 @@
   \if at anim@export\else\leavevmode\fi%
   \@anim at reset% to default settings
   \if at 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 at version\space-->%
@@ -2845,9 +2864,8 @@
 \define at key{anim at user}{angle}{%
   \xdef\@anim at angle{angle=#1}%
 }
-\newboolean{@anim at clip}
-\define at key{anim at usr}{clip}[true]{%
-  \setboolean{@anim at clip}{#1}%
+\define at key{anim at user}{clip}[true]{%
+  %no-op, as embedded graphics are always clipped to widget box
 }
 \newboolean{@anim at hiresbb}
 \define at key{anim at user}{hiresbb}[true]{%
@@ -3158,7 +3176,6 @@
   \global\let\@anim at viewport\@anim@@viewport%
   \global\let\@anim at trim\@anim@@trim%
   \global\let\@anim at angle\@anim@@angle%
-  \global\let\if at anim@clip=\if at anim@@clip%
   \global\let\if at anim@hiresbb=\if at anim@@hiresbb%
   \global\let\if at anim@interpolate=\if at anim@@interpolate%
   \global\let\@anim at pagebox\@anim@@pagebox%
@@ -3376,9 +3393,8 @@
 \define at key{anim at pkg}{angle}{%
   \xdef\@anim@@angle{angle=#1}%
 }
-\newboolean{@anim@@clip}
 \define at key{anim at pkg}{clip}[true]{%
-  \setboolean{@anim@@clip}{#1}%
+  %no-op, as embedded graphics are always clipped to widget box
 }
 \newboolean{@anim@@hiresbb}
 \define at key{anim at pkg}{hiresbb}[true]{%



More information about the tex-live-commits mailing list.