| 1 |
<?xml version="1.0" standalone="no"?> |
| 2 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" |
| 3 |
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.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 |
<!-- check updates on gradients, filter, mask, and clip regarding to --> |
| 25 |
<!-- geometry updates --> |
| 26 |
<!-- --> |
| 27 |
<!-- @author [email protected] --> |
| 28 |
<!-- @version $Id$ --> |
| 29 |
<!-- ====================================================================== --> |
| 30 |
|
| 31 |
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| 32 |
|
| 33 |
<svg xmlns="http://www.w3.org/2000/svg" |
| 34 |
xmlns:xlink="http://www.w3.org/1999/xlink" |
| 35 |
id="body" width="450" height="500" viewBox="0 0 450 500"> |
| 36 |
|
| 37 |
<title>Filter and pattern with geometry updates</title> |
| 38 |
|
| 39 |
<text x="50%" y="25" class="title">Filter and pattern with geometry updates |
| 40 |
<tspan x="50%" dy="1.1em" style="font-style:italic; font-size:12">(click on all shapes and see |
| 41 |
<a style="fill:blue" xlink:href="filterPatternUpdateRef.svg">filterPatternUpdateRef.svg</a>)</tspan></text> |
| 42 |
|
| 43 |
<script type="text/ecmascript"> |
| 44 |
|
| 45 |
var svgNamespaceURI = "http://www.w3.org/2000/svg"; |
| 46 |
|
| 47 |
function move(evt) { |
| 48 |
var x = parseFloat(evt.target.getAttribute("x")); |
| 49 |
var y = parseFloat(evt.target.getAttribute("y")); |
| 50 |
evt.target.setAttribute("x", x+90); |
| 51 |
evt.target.setAttribute("y", y+85); |
| 52 |
} |
| 53 |
|
| 54 |
</script> |
| 55 |
|
| 56 |
<defs> |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
<filter id="filterObjectBoundingBox" primitiveUnits="objectBoundingBox" filterUnits="objectBoundingBox" |
| 61 |
x="0" y="0" width="1" height="1"> |
| 62 |
<feTurbulence x="0" y="0" width="1" height="1" type="turbulence" baseFrequency="0.1" numOctaves="2" /> |
| 63 |
</filter> |
| 64 |
|
| 65 |
<filter id="filterUserSpaceOnUse" primitiveUnits="objectBoundingBox" filterUnits="userSpaceOnUse"> |
| 66 |
<feTurbulence x="0" y="0" width="1" height="1" type="turbulence" baseFrequency="0.1" numOctaves="2" /> |
| 67 |
</filter> |
| 68 |
|
| 69 |
<pattern id="patternObjectBoundingBox" patternContentUnits="userSpaceOnUse" patternUnits="objectBoundingBox" |
| 70 |
x="0" y="0" width="1" height="1" viewBox="0 0 20 20"> |
| 71 |
<rect x="0" y="0" width="10" height="10" fill="#eee" /> |
| 72 |
<rect x="10" y="0" width="10" height="10" fill="black" /> |
| 73 |
<rect x="0" y="10" width="10" height="10" fill="black" /> |
| 74 |
<rect x="10" y="10" width="10" height="10" fill="#eee" /> |
| 75 |
</pattern> |
| 76 |
|
| 77 |
<pattern id="patternUserSpaceOnUse" patternContentUnits="userSpaceOnUse" patternUnits="userSpaceOnUse" |
| 78 |
x="250" y="300" width="20" height="20" viewBox="250 300 20 20" > |
| 79 |
<rect x="250" y="300" width="10" height="10" fill="#eee" /> |
| 80 |
<rect x="260" y="300" width="10" height="10" fill="black" /> |
| 81 |
<rect x="250" y="310" width="10" height="10" fill="black" /> |
| 82 |
<rect x="260" y="310" width="10" height="10" fill="#eee" /> |
| 83 |
</pattern> |
| 84 |
|
| 85 |
</defs> |
| 86 |
|
| 87 |
|
| 88 |
<g id="test-content" transform="translate(0,-20)"> |
| 89 |
|
| 90 |
<g id="board" style="fill:none; stroke:black"> |
| 91 |
<rect x="40" y="80" width="200" height="20" style="fill:#eee"/> |
| 92 |
<rect x="240" y="80" width="200" height="20" style="fill:#eee"/> |
| 93 |
|
| 94 |
<rect x="40" y="100" width="200" height="380" /> |
| 95 |
<rect x="240" y="100" width="200" height="380" /> |
| 96 |
|
| 97 |
<line x1="20" y1="290" x2="440" y2="290" /> |
| 98 |
<rect x="20" y="100" width="20" height="190" style="fill:#eee"/> |
| 99 |
<rect x="20" y="290" width="20" height="190" style="fill:#eee"/> |
| 100 |
|
| 101 |
<g style="fill:black; stroke:none; text-anchor:middle"> |
| 102 |
<text x="134" y="94">objectBoundingBox</text> |
| 103 |
<text x="314" y="94">userSpaceOnUse</text> |
| 104 |
<text x="0" y="0" transform="translate(34 200)rotate(-90)"><filter></text> |
| 105 |
<text x="0" y="0" transform="translate(34 380)rotate(-90)"><pattern></text> |
| 106 |
</g> |
| 107 |
</g> |
| 108 |
|
| 109 |
<rect onclick="move(evt)" x="50" y="110" width="90" height="85" style="filter:url(#filterObjectBoundingBox)"/> |
| 110 |
<rect onclick="move(evt)" x="250" y="110" width="90" height="85" style="filter:url(#filterUserSpaceOnUse)"/> |
| 111 |
|
| 112 |
<rect onclick="move(evt)" x="50" y="300" width="90" height="85" style="fill:url(#patternObjectBoundingBox)"/> |
| 113 |
<rect onclick="move(evt)" x="250" y="300" width="90" height="85" style="fill:url(#patternUserSpaceOnUse)"/> |
| 114 |
|
| 115 |
</g> |
| 116 |
|
| 117 |
|
| 118 |
<script type="text/ecmascript"><![CDATA[ |
| 119 |
function onDone() { |
| 120 |
if (!(regardTestInstance == null)) { |
| 121 |
regardTestInstance.scriptDone(); |
| 122 |
} else { |
| 123 |
alert("This button only works when run in the regard framework"); |
| 124 |
} |
| 125 |
} |
| 126 |
]]></script> |
| 127 |
<g id="done" transform="translate(195, 468)" cursor="pointer" onclick="onDone()"> |
| 128 |
<rect rx="5" ry="5" width="60" height="25" fill="#eeeeee" stroke="black" /> |
| 129 |
<text x="30" y="18" font-size="14" font-weight="bold" text-anchor="middle">Done</text> |
| 130 |
</g> |
| 131 |
|
| 132 |
</svg> |