diff options
-rw-r--r-- | test_suite/bug/basique.svg | 113 | ||||
-rwxr-xr-x | test_suite/bug/bug_mpath.pl | 53 |
2 files changed, 166 insertions, 0 deletions
diff --git a/test_suite/bug/basique.svg b/test_suite/bug/basique.svg new file mode 100644 index 0000000..cd0606f --- /dev/null +++ b/test_suite/bug/basique.svg @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.44.1" + sodipodi:docbase="/home/ribet/mtools/doc" + sodipodi:docname="basique.svg" + version="1.0"> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient3649"> + <stop + style="stop-color:#f09600;stop-opacity:1;" + offset="0" + id="stop3651" /> + <stop + style="stop-color:#f09600;stop-opacity:0;" + offset="1" + id="stop3653" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3649" + id="linearGradient3655" + x1="424.21429" + y1="209.50504" + x2="604.35712" + y2="66.647896" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.35" + inkscape:cx="375" + inkscape:cy="520" + inkscape:document-units="px" + inkscape:current-layer="layer1" + inkscape:window-width="1202" + inkscape:window-height="998" + inkscape:window-x="1881" + inkscape:window-y="78" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Calque 1" + inkscape:groupmode="layer" + id="layer1"> + <rect + style="opacity:1;fill:#f09600;fill-opacity:0.66123777;stroke:#cc2828;stroke-width:3;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:12, 12;stroke-dashoffset:30;stroke-opacity:0.83061894" + id="rect1872" + width="331.42856" + height="151.42857" + x="71.428574" + y="72.362183" + ry="13.736895" /> + <rect + style="opacity:1;fill:#f09600;fill-opacity:0.66123777;stroke:#cc2828;stroke-width:3;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:12, 12;stroke-dashoffset:30;stroke-opacity:0.83061894" + id="rect2760" + width="234.28572" + height="142.85715" + x="222.85715" + y="138.07646" + ry="13.736895" /> + <path + sodipodi:type="arc" + style="opacity:1;fill:url(#linearGradient3655);fill-opacity:1;stroke:#cc2828;stroke-width:3;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:12, 12;stroke-dashoffset:30;stroke-opacity:0.83061894" + id="ellipse" + sodipodi:cx="508.57144" + sodipodi:cy="140.93361" + sodipodi:rx="145.71428" + sodipodi:ry="105.71429" + d="M 654.28572,140.93361 A 145.71428,105.71429 0 1 1 654.21719,137.69189" + sodipodi:start="0" + sodipodi:end="6.2525156" + sodipodi:open="true" + transform="translate(-340,160)" /> + <rect + style="opacity:1;fill:#cb00f0;fill-opacity:0.66123777;stroke:#cc2828;stroke-width:3;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:12, 12;stroke-dashoffset:30;stroke-opacity:0.83061894" + id="mauve" + width="165.71428" + height="125.71429" + x="382.85715" + y="55.219326" + ry="13.736895" /> + </g> +</svg> diff --git a/test_suite/bug/bug_mpath.pl b/test_suite/bug/bug_mpath.pl new file mode 100755 index 0000000..53cb5f6 --- /dev/null +++ b/test_suite/bug/bug_mpath.pl @@ -0,0 +1,53 @@ +#!/usr/bin/perl +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU GPL General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, +# or refer to http://www.gnu.org/copyleft/gpl.html +# + +BEGIN { + unshift @INC, ".", "../src", "../../src"; +} + +use MTools; +use MTools::MSwitch; +use MTools::MTimer; +use MTools::Anim::MPath; + +new MTools (800, 600, "Bug en fin d'animation"); + +my $mauve = minstance("basique.svg#mauve", 1); +rotate($mauve, 45); + +my $anim = new MTools::Anim::MPath(targets => $mauve, + path => [[0, 0], + [100, -300], + [200, 0], + [0, 0]]); + +my $switch = new MTools::MSwitch(1, + anim => ["basique.svg#layer1", $mauve,$anim], + complet => ["basique.svg#layer1", $mauve]); +$switch->setState(complet); + +my @states = qw(complet anim); +my $timer = new MTools::MTimer(2000, 1, \&switch); +$timer->start(); + +mrun; + +sub switch { + my $new_state = pop @states; + $switch->setState($new_state); + unshift @states, $new_state; +} |