summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-01-21 22:48:27 +0000
committerKarl Berry <karl@freefriends.org>2022-01-21 22:48:27 +0000
commit5452f31177703a5cefb54841ad54a94d3043304f (patch)
tree83af60efb7b78fe4b7f8915d73efe7b877bf5ba3
parent1e6795b6fd7161803fd11f3144e6eab5f4577f06 (diff)
animate (21jan22)
git-svn-id: svn://tug.org/texlive/trunk@61683 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/animate/ChangeLog3
-rw-r--r--Master/texmf-dist/doc/latex/animate/README.txt4
-rw-r--r--Master/texmf-dist/doc/latex/animate/animate.pdfbin3862673 -> 3871621 bytes
-rw-r--r--Master/texmf-dist/source/latex/animate/animate.tex9
-rw-r--r--Master/texmf-dist/source/latex/animate/files/scarab.mp18
-rw-r--r--Master/texmf-dist/tex/latex/animate/animate.sty52
6 files changed, 48 insertions, 38 deletions
diff --git a/Master/texmf-dist/doc/latex/animate/ChangeLog b/Master/texmf-dist/doc/latex/animate/ChangeLog
index bc005021448..1c2cbfcd747 100644
--- a/Master/texmf-dist/doc/latex/animate/ChangeLog
+++ b/Master/texmf-dist/doc/latex/animate/ChangeLog
@@ -1,3 +1,6 @@
+2022-01-21
+ * fix: clipping for dvisvgm
+
2021-11-09
* improvement: play from beginning, regardless of poster frame setting
diff --git a/Master/texmf-dist/doc/latex/animate/README.txt b/Master/texmf-dist/doc/latex/animate/README.txt
index eff30cb2c82..320227faac4 100644
--- a/Master/texmf-dist/doc/latex/animate/README.txt
+++ b/Master/texmf-dist/doc/latex/animate/README.txt
@@ -48,7 +48,7 @@ and examples.
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 @@ and examples.
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,
diff --git a/Master/texmf-dist/doc/latex/animate/animate.pdf b/Master/texmf-dist/doc/latex/animate/animate.pdf
index 2b0b39f0f10..5c84024b339 100644
--- a/Master/texmf-dist/doc/latex/animate/animate.pdf
+++ b/Master/texmf-dist/doc/latex/animate/animate.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/animate/animate.tex b/Master/texmf-dist/source/latex/animate/animate.tex
index b85eaa7b504..6d3101f084a 100644
--- a/Master/texmf-dist/source/latex/animate/animate.tex
+++ b/Master/texmf-dist/source/latex/animate/animate.tex
@@ -174,7 +174,6 @@ scale=<factor>
bb=<llx> <lly> <urx> <ury>
viewport=<llx> <lly> <urx> <ury>
trim=<left> <bottom> <right> <top>
-clip
hiresbb
interpolate
pagebox=...
@@ -348,10 +347,10 @@ viewport=<llx> <lly> <urx> <ury>
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
diff --git a/Master/texmf-dist/source/latex/animate/files/scarab.mp b/Master/texmf-dist/source/latex/animate/files/scarab.mp
index ff4b9ebc6a1..038157ead60 100644
--- a/Master/texmf-dist/source/latex/animate/files/scarab.mp
+++ b/Master/texmf-dist/source/latex/animate/files/scarab.mp
@@ -1,5 +1,5 @@
% Maxime Chupin, Alexander Grahn
-% 2021/04/08
+% 2022/01/21
prologues:=3;
outputtemplate := "%j_%c.mps";
@@ -75,16 +75,12 @@ for i:=0 upto 100:
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,15 +89,13 @@ for i:=0 upto 100:
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)
- 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
+ setbounds currentpicture to
(u,1.2u)--(u,-1.2u)--(-1.5u,-1.2u)--(-1.5u,1.2u)--cycle;
endfig;
fi;
@@ -109,8 +103,6 @@ endfor;
%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 @@ beginfig(253);
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;
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]{%