Debian Codegraph @

samples/tests/spec/scripting/boundsTransformChange.svg

raw
1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
3 "http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">
4
5 <!--
6
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
13
14 http://www.apache.org/licenses/LICENSE-2.0
15
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
21
22 -->
23 <!-- ====================================================================== -->
24 <!-- Modification of a circle attributes -->
25 <!-- -->
26 <!-- @author [email protected] -->
27 <!-- @version $Id$ -->
28 <!-- ====================================================================== -->
29
30 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
31
32 <svg xmlns="http://www.w3.org/2000/svg" id="body" width="450" height="500" viewBox="0 0 450 500"
33 onload="updateGroup1()">
34 <title>Testing Update engine when bounds and transform change.</title>
35
36 <desc>This tests changing the bounds of an object then changing a
37 a parent's transform to ensure the dirty regions are properly
38 computed.</desc>
39 <script type="text/ecmascript"><![CDATA[
40 var inRegard=false;
41 var time1 = 90;
42 function updateGroup1() {
43 var elt = document.getElementById("g1");
44 var fs = Math.cos(time1*2*3.1415926/180)*12+24;
45 elt.setAttribute("font-size",fs);
46
47 var x = Math.cos(time1*3.1415926/180)*100 + 225;
48 var y = Math.sin(.5*(time1+90)*3.1415926/180)*150 + 250;
49 elt.setAttribute("transform", "translate("+x+","+y+")");
50 time1 += 20;
51 if (inRegard && (time1 >= 270))
52 regardTestInstance.scriptDone();
53 else
54 setTimeout('updateGroup1()', 100);
55 }
56 function regardStart() {
57 inRegard = true;
58 }
59 ]]></script>
60
61 <g id="test-content">
62 <g id="g1">
63 <text text-anchor="middle">Squash the Bug</text>
64 </g>
65 </g>
66 </svg>
67