| 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(); updateGroup2()"> |
| 34 |
<title>Testing Update engine when root changes size/location.</title> |
| 35 |
|
| 36 |
<desc>To ensure proper test results you may need to turn off |
| 37 |
double buffering and pause the animation and force a repaint, if |
| 38 |
you see lots of junk then the repaint engine is not working |
| 39 |
properly.</desc> |
| 40 |
<script type="text/ecmascript"><![CDATA[ |
| 41 |
var inRegard = false; |
| 42 |
var time1 = 70; |
| 43 |
function updateGroup1() { |
| 44 |
var elt = document.getElementById("g1"); |
| 45 |
var x = Math.cos(time1*3.1415926/180)*150 + 225; |
| 46 |
var y = Math.sin(.5*(time1+90)*3.1415926/180)*150 + 250; |
| 47 |
elt.setAttributeNS(null, "transform", |
| 48 |
"translate("+x+","+y+")"); |
| 49 |
time1 += 15; |
| 50 |
if (!inRegard || (time1 < 470)) |
| 51 |
setTimeout('updateGroup1()', 100); |
| 52 |
if (inRegard && (time2 <= -290) && (time1 >= 470)) |
| 53 |
regardTestInstance.scriptDone(); |
| 54 |
} |
| 55 |
var time2 = 110; |
| 56 |
function updateGroup2() { |
| 57 |
var elt = document.getElementById("g2"); |
| 58 |
var x = Math.cos(time2*3.1415926/180)*150 + 225; |
| 59 |
var y = Math.sin(.5*(time2+90)*3.1415926/180)*150 + 250; |
| 60 |
elt.setAttributeNS(null, "transform", |
| 61 |
"translate("+x+","+y+")"); |
| 62 |
time2 -= 15; |
| 63 |
if (!inRegard || (time2 > -290)) |
| 64 |
setTimeout('updateGroup2()', 100); |
| 65 |
if (inRegard && (time2 <= -290) && (time1 >= 470)) |
| 66 |
regardTestInstance.scriptDone(); |
| 67 |
} |
| 68 |
function regardStart() { |
| 69 |
inRegard = true; |
| 70 |
} |
| 71 |
]]></script> |
| 72 |
|
| 73 |
<g id="test-content"> |
| 74 |
<g id="g1"> |
| 75 |
<rect x="-15" y="-25" width="30" height="50" |
| 76 |
fill="none" stroke="black"/> |
| 77 |
<circle cx="0" cy="0" r="10" fill="red"/> |
| 78 |
</g> |
| 79 |
<g id="g2"> |
| 80 |
<rect x="-15" y="-25" width="30" height="50" |
| 81 |
fill="none" stroke="black"/> |
| 82 |
<circle cx="0" cy="0" r="10" fill="blue"/> |
| 83 |
</g> |
| 84 |
</g> |
| 85 |
</svg> |
| 86 |
|