Debian Codegraph @

samples/tests/spec/scripting/maskClipUpdate.svg

raw
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>Clip and mask with geometry updates</title>
38
39 <text x="50%" y="25" class="title">Clip and mask 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="maskClipUpdateRef.svg">maskClipUpdateRef.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 <clipPath id="clipObjectBoundingBox" clipPathUnits="objectBoundingBox">
59 <circle cx=".5" cy=".5" r=".5" />
60 </clipPath>
61
62 <clipPath id="clipUserSpaceOnUse" clipPathUnits="userSpaceOnUse">
63 <circle cx="340" cy="195" r="80" />
64 </clipPath>
65
66 <mask id="maskObjectBoundingBox" maskContentUnits="objectBoundingBox" maskUnits="objectBoundingBox"
67 x="0" y="0" width="1" height="1">
68 <circle cx=".5" cy=".5" r=".5" fill="white"/>
69 </mask>
70
71 <mask id="maskUserSpaceOnUse" maskContentUnits="userSpaceOnUse" maskUnits="userSpaceOnUse"
72 x="250" y="300" width="180" height="190">
73 <circle cx="340" cy="390" r="80" fill="white"/>
74 </mask>
75
76 </defs>
77
78
79 <g id="test-content" transform="translate(0, -20)">
80
81 <g id="board" style="fill:none; stroke:black">
82 <rect x="40" y="80" width="200" height="20" style="fill:#eee"/>
83 <rect x="240" y="80" width="200" height="20" style="fill:#eee"/>
84
85 <rect x="40" y="100" width="200" height="380" />
86 <rect x="240" y="100" width="200" height="380" />
87
88 <line x1="20" y1="290" x2="440" y2="290" />
89 <rect x="20" y="100" width="20" height="190" style="fill:#eee"/>
90 <rect x="20" y="290" width="20" height="190" style="fill:#eee"/>
91
92 <g style="fill:black; stroke:none; text-anchor:middle">
93 <text x="134" y="94">objectBoundingBox</text>
94 <text x="314" y="94">userSpaceOnUse</text>
95 <text x="0" y="0" transform="translate(34 200)rotate(-90)">&lt;clipPath></text>
96 <text x="0" y="0" transform="translate(34 380)rotate(-90)">&lt;mask></text>
97 </g>
98 </g>
99
100 <rect onclick="move(evt)" x="50" y="110" width="90" height="85" style="fill:crimson; clip-path:url(#clipObjectBoundingBox)"/>
101 <rect onclick="move(evt)" x="250" y="110" width="90" height="85" style="fill:crimson; clip-path:url(#clipUserSpaceOnUse)"/>
102
103 <rect onclick="move(evt)" x="50" y="300" width="90" height="85" style="fill:crimson; mask:url(#maskObjectBoundingBox)"/>
104 <rect onclick="move(evt)" x="250" y="300" width="90" height="85" style="fill:crimson; mask:url(#maskUserSpaceOnUse)"/>
105
106 </g>
107
108
109
110 <script type="text/ecmascript"><![CDATA[
111 function onDone() {
112 if (!(regardTestInstance == null)) {
113 regardTestInstance.scriptDone();
114 } else {
115 alert("This button only works when run in the regard framework");
116 }
117 }
118 ]]></script>
119 <g id="done" transform="translate(195, 468)" cursor="pointer" onclick="onDone()">
120 <rect rx="5" ry="5" width="60" height="25" fill="#eeeeee" stroke="black" />
121 <text x="30" y="18" font-size="14" font-weight="bold" text-anchor="middle">Done</text>
122 </g>
123
124
125
126 </svg>