pgf icon indicating copy to clipboard operation
pgf copied to clipboard

No animation in example for "Animation attribute :text"

Open gabor-braun opened this issue 3 years ago • 0 comments

Brief outline of the bug

In the documentation go to "Animation attribute :text". The snapshots in the first example look the same, no visible changes, even though this ought to be a working animation. (The second example showing no changes matches the text.)

Minimal working example (MWE)

This is an extended example from the documentation to include a multiple part node, too.

\documentclass[tikz]{standalone}
\usepackage{trace}
\usetikzlibrary{animations, shapes.multipart}

\begin{document}
\begin{tikzpicture}[my anim/.style={ animate = {
      myself:text = {0s = "red", 2s = "blue", begin on = click}}},
  text = white, fill = orange ]
  \traceon
    \node [fill, my anim] at (0,0) {A};
    \node [fill, rectangle split, rectangle split parts=2, my anim]
    at (1,0) {B \nodepart{two} C};
  \traceoff
\end{tikzpicture}
\end{document}

Here is the output with driver dvisvgm (with all optimization of the driver). Note that the text color is specified on text element, but animated on ancestor elements (with id pgf0t and pgf1t), so they have no effect. The letter C doesn't have even this animation.

<?xml version='1.0' encoding='UTF-8'?>
<!-- This file was generated by dvisvgm 2.11.1 -->
<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='42.321106pt' height='27.694665pt' viewBox='-72.000004 -72.000001 42.321106 27.694665'>
<defs>
<font id='cmr10' horiz-adv-x='0'>
<font-face font-family='cmr10' units-per-em='1000' ascent='750' descent='250'/>
<glyph unicode='A' horiz-adv-x='750' vert-adv-y='750' glyph-name='A' d='M398 696C393 709 391 716 375 716S356 710 351 696L144 98C126 47 86 32 32 31V0C55 1 98 3 134 3C165 3 217 1 249 0V31C199 31 174 56 174 82C174 85 175 95 176 97L222 228H469L522 75C523 71 525 65 525 61C525 31 469 31 442 31V0C478 3 548 3 586 3C629 3 675 2 717 0V31H699C639 31 625 38 614 71L398 696ZM345 584L458 259H233L345 584Z'/>
<glyph unicode='B' horiz-adv-x='708' vert-adv-y='708' glyph-name='B' d='M222 366V612C222 645 224 652 271 652H395C492 652 527 567 527 514C527 450 478 366 367 366H222ZM458 357C555 376 624 440 624 514C624 601 532 683 402 683H36V652H60C137 652 139 641 139 605V78C139 42 137 31 60 31H36V0H428C561 0 651 89 651 183C651 270 569 345 458 357ZM396 31H271C224 31 222 38 222 71V344H410C509 344 551 251 551 184C551 113 499 31 396 31Z'/>
<glyph unicode='C' horiz-adv-x='722' vert-adv-y='722' glyph-name='C' d='M56 342C56 135 218-22 404-22C567-22 665 117 665 233C665 243 665 250 652 250C641 250 641 244 640 234C632 91 525 9 416 9C355 9 159 43 159 341C159 640 354 674 415 674C524 674 613 583 633 437C635 423 635 420 649 420C665 420 665 423 665 444V681C665 698 665 705 654 705C650 705 646 705 638 693L588 619C551 655 500 705 404 705C217 705 56 546 56 342Z'/>
</font>
</defs>
<style type='text/css'>
<![CDATA[text.f0 {font-family:cmr10;font-size:9.96264px}
]]>
</style>
<g id='page1'>
<g stroke-miterlimit='10' transform='matrix(.996264 0 0 -.996264 -64.943489 -58.15267)' fill='#ff8000' stroke='#000' stroke-width='0.4'>
<animate attributeName='fill' begin='pgf0.click +0.0s' calcMode='spline' dur='2.0' keySplines='0 0 1 1' keyTimes='0.0;1.0' values='#f00;#00f' xlink:href='#pgf0t'/>
<animate attributeName='stroke' begin='pgf0.click +0.0s' calcMode='spline' dur='2.0' keySplines='0 0 1 1' keyTimes='0.0;1.0' values='#f00;#00f' xlink:href='#pgf0t'/>
<g id='pgf0'>
<g id='pgf0b'>
<path d='M -7.08298 -6.74963 h 14.16595 v 13.49927 h -14.16595 Z' id='pgf0bp' stroke='none'/>
</g>
<g transform='translate(-3.75 -3.41666)matrix(1.00375 0 0 -1.00375 65.187027 -58.370743)' stroke='none' fill='#fff'>
<g id='pgf0t'>
<g stroke='none'>
<text class='f0' x='-64.943489' y='-58.15267' fill='#fff'>A</text>
</g>
</g>
</g>
</g>
<animate attributeName='fill' begin='pgf1.click +0.0s' calcMode='spline' dur='2.0' keySplines='0 0 1 1' keyTimes='0.0;1.0' values='#f00;#00f' xlink:href='#pgf1t'/>
<animate attributeName='stroke' begin='pgf1.click +0.0s' calcMode='spline' dur='2.0' keySplines='0 0 1 1' keyTimes='0.0;1.0' values='#f00;#00f' xlink:href='#pgf1t'/>
<g id='pgf1'>
<g id='pgf1y1'>
</g>
<g id='pgf1b'>
<path d='M 21.50865 -13.89926 h 13.88818 v 27.79852 h -13.88818 Z M 35.39684 0.0 L 21.50865 0.0' id='pgf1bp' stroke='none'/>
</g>
<g transform='translate(24.91106 3.53297)matrix(1.00375 0 0 -1.00375 65.187027 -58.370743)' stroke='none' fill='#fff'>
<g id='pgf1t'>
<g stroke='none'>
<text class='f0' x='-64.943489' y='-58.15267' fill='#fff'>B</text>
</g>
</g>
</g>
<g transform='translate(24.84163 -10.36629)matrix(1.00375 0 0 -1.00375 65.187027 -58.370743)' stroke='none'>
<text class='f0' x='-64.943489' y='-58.15267' fill='#fff'>C</text>
</g>
</g>
</g>
</g>
</svg>

gabor-braun avatar Dec 12 '21 19:12 gabor-braun