Debian Codegraph @

samples/tests/spec/structure/rasterImageViewBoxOverflow.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 <!-- This example validates the handling of viewBox and preserveAspectRatio -->
25 <!-- for <image> elements. -->
26 <!-- -->
27 <!-- @author [email protected] -->
28 <!-- @version $Id$ -->
29 <!-- ========================================================================= -->
30 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
31
32 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500">
33 <title>&lt;image&gt; and viewBox &amp; preserveAspectRatio</title>
34
35 <style type="text/css"><![CDATA[
36 .label { text-anchor: middle; }
37 .oddRow { fill:white; stroke:black; }
38 .evenRow { fill:#eeeeee; stroke:black; }
39 ]]></style>
40
41 <g id="content">
42
43 <text class="title" x="50%" y="30">viewBox &amp; preserveAspectRatio on</text>
44 <text class="title" x="50%" y="50">raster &lt;image&gt; with overflow="visible"</text>
45
46 <g id="table" class="label" transform="translate(80, 60)">
47 <rect width="110" height="20" class="oddRow" />
48 <text x="55" y="15">meet</text>
49 <rect width="110" height="20" class="oddRow" transform="translate(110,0)"/>
50 <text x="55" y="15" transform="translate(110, 0)">slice</text>
51 <rect width="110" height="20" class="oddRow" transform="translate(220,0)"/>
52 <text x="55" y="15" transform="translate(220, 0)">unspecified</text>
53
54 <g id="yMXX">
55 <rect x="-20" y="20" width="20" height="40" class="oddRow" />
56 <text x="-5" y="40" transform="rotate(-90,-5,40)">yMin</text>
57
58 <g transform="translate(0,40)">
59 <rect x="-20" y="20" width="20" height="40" class="evenRow" />
60 <text x="-5" y="40" transform="rotate(-90,-5,40)">yMid</text>
61 </g>
62
63 <g transform="translate(0,80)">
64 <rect x="-20" y="20" width="20" height="40" class="oddRow" />
65 <text x="-5" y="40" transform="rotate(-90,-5,40)">yMax</text>
66 </g>
67 </g>
68
69
70 <g transform="translate(0,120)">
71 <rect x="-20" y="20" width="20" height="40" class="oddRow" />
72 <text x="-5" y="40" transform="rotate(-90,-5,40)">yMin</text>
73
74 <g transform="translate(0,40)">
75 <rect x="-20" y="20" width="20" height="40" class="evenRow" />
76 <text x="-5" y="40" transform="rotate(-90,-5,40)">yMid</text>
77 </g>
78
79 <g transform="translate(0,80)">
80 <rect x="-20" y="20" width="20" height="40" class="oddRow" />
81 <text x="-5" y="40" transform="rotate(-90,-5,40)">yMax</text>
82 </g>
83 </g>
84
85 <g transform="translate(0,240)">
86 <rect x="-20" y="20" width="20" height="40" class="oddRow" />
87 <text x="-5" y="40" transform="rotate(-90,-5,40)">yMin</text>
88
89 <g transform="translate(0,40)">
90 <rect x="-20" y="20" width="20" height="40" class="evenRow" />
91 <text x="-5" y="40" transform="rotate(-90,-5,40)">yMid</text>
92 </g>
93
94 <g transform="translate(0,80)">
95 <rect x="-20" y="20" width="20" height="40" class="oddRow" />
96 <text x="-5" y="40" transform="rotate(-90,-5,40)">yMax</text>
97 </g>
98 </g>
99
100 <rect x="-40" y="20" width="20" height="120" class="evenRow" />
101 <text x="-25" y="80" transform="rotate(-90,-25,80)">xMin</text>
102
103 <g transform="translate(0,120)">
104 <rect x="-40" y="20" width="20" height="120" class="oddRow" />
105 <text x="-25" y="80" transform="rotate(-90,-25,80)">xMid</text>
106 </g>
107
108 <g transform="translate(0,240)">
109 <rect x="-40" y="20" width="20" height="120" class="evenRow" />
110 <text x="-25" y="80" transform="rotate(-90,-25,80)">xMax</text>
111 </g>
112
113 <defs>
114 <g id="row">
115 <rect width="110" height="40" transform="translate(0 ,20)"/>
116 <rect width="110" height="40" transform="translate(110,20)"/>
117 <rect width="110" height="40" transform="translate(220,20)"/>
118 </g>
119 </defs>
120
121 <g id="evenRowBlock">
122 <use xlink:href="#row" class="evenRow" transform="translate(0,0)"/>
123 <use xlink:href="#row" class="oddRow" transform="translate(0,40)"/>
124 <use xlink:href="#row" class="evenRow" transform="translate(0,80)"/>
125 </g>
126
127 <g id="oddRowBlock" transform="translate(0,120)">
128 <use xlink:href="#row" class="oddRow" transform="translate(0,0)"/>
129 <use xlink:href="#row" class="evenRow" transform="translate(0,40)"/>
130 <use xlink:href="#row" class="oddRow" transform="translate(0,80)"/>
131 </g>
132
133 <use xlink:href="#evenRowBlock" transform="translate(0,240)"/>
134
135 <rect x="-40" y="380" width="40" height="40" fill="white" stroke="black" />
136 <text x="-15" y="400" transform="rotate(-90, -15, 400)">none</text>
137 <use xlink:href="#row" class="oddRow" transform="translate(0,360)" />
138
139 <line x1="55" y1="20" x2="55" y2="420" stroke="black" />
140 <line x1="165" y1="20" x2="165" y2="420" stroke="black" />
141 <line x1="275" y1="20" x2="275" y2="420" stroke="black" />
142 </g>
143
144 <g id="testCases" transform="translate(80, 80)">
145 <defs>
146 <rect id="hViewBox" x="12.5" y="7.5" width="30" height="25" stroke="red" fill="none"/>
147 <rect id="vViewBox" x="72.5" y="7.5" width="20" height="25" stroke="red" fill="none"/>
148 </defs>
149
150 <!-- xMinYXXX XXX -->
151 <g>
152 <!-- ... YMin XXX -->
153 <g>
154 <g>
155 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMin meet" x="12.5" y="7.5" width="30" height="25" />
156 <use xlink:href="#hViewBox" />
157
158 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMin meet" x="72.5" y="7.5" width="20" height="25" />
159 <use xlink:href="#vViewBox" />
160 </g>
161
162 <g transform="translate(110, 0)">
163 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMin slice" x="12.5" y="7.5" width="30" height="25" />
164 <use xlink:href="#hViewBox" />
165
166 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMin slice" x="72.5" y="7.5" width="20" height="25" />
167 <use xlink:href="#vViewBox" />
168 </g>
169
170 <g transform="translate(220, 0)">
171 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMin" x="12.5" y="7.5" width="30" height="25" />
172 <use xlink:href="#hViewBox" />
173
174 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMin" x="72.5" y="7.5" width="20" height="25" />
175 <use xlink:href="#vViewBox" />
176 </g>
177 </g>
178
179 <!-- ... YMid XXX -->
180 <g transform="translate(0, 40)">
181 <g>
182 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMid meet" x="12.5" y="7.5" width="30" height="25" />
183 <use xlink:href="#hViewBox" />
184
185 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMid meet" x="72.5" y="7.5" width="20" height="25" />
186 <use xlink:href="#vViewBox" />
187 </g>
188
189 <g transform="translate(110, 0)">
190 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMid slice" x="12.5" y="7.5" width="30" height="25" />
191 <use xlink:href="#hViewBox" />
192
193 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMid slice" x="72.5" y="7.5" width="20" height="25" />
194 <use xlink:href="#vViewBox" />
195 </g>
196
197 <g transform="translate(220, 0)">
198 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMid" x="12.5" y="7.5" width="30" height="25" />
199 <use xlink:href="#hViewBox" />
200
201 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMid" x="72.5" y="7.5" width="20" height="25" />
202 <use xlink:href="#vViewBox" />
203 </g>
204 </g>
205
206 <!-- ... YMax XXX -->
207 <g transform="translate(0, 80)">
208 <g>
209 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMax meet" x="12.5" y="7.5" width="30" height="25" />
210 <use xlink:href="#hViewBox" />
211
212 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMax meet" x="72.5" y="7.5" width="20" height="25" />
213 <use xlink:href="#vViewBox" />
214 </g>
215
216 <g transform="translate(110, 0)">
217 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMax slice" x="12.5" y="7.5" width="30" height="25" />
218 <use xlink:href="#hViewBox" />
219
220 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMax slice" x="72.5" y="7.5" width="20" height="25" />
221 <use xlink:href="#vViewBox" />
222 </g>
223
224 <g transform="translate(220, 0)">
225 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMax" x="12.5" y="7.5" width="30" height="25" />
226 <use xlink:href="#hViewBox" />
227
228 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMinYMax" x="72.5" y="7.5" width="20" height="25" />
229 <use xlink:href="#vViewBox" />
230 </g>
231 </g>
232 </g>
233
234
235 <!-- xMidYXXX XXX -->
236 <g transform="translate(0, 120)">
237 <!-- ... YMin XXX -->
238 <g>
239 <g>
240 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMin meet" x="12.5" y="7.5" width="30" height="25" />
241 <use xlink:href="#hViewBox" />
242
243 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMin meet" x="72.5" y="7.5" width="20" height="25" />
244 <use xlink:href="#vViewBox" />
245 </g>
246
247 <g transform="translate(110, 0)">
248 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMin slice" x="12.5" y="7.5" width="30" height="25" />
249 <use xlink:href="#hViewBox" />
250
251 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMin slice" x="72.5" y="7.5" width="20" height="25" />
252 <use xlink:href="#vViewBox" />
253 </g>
254
255 <g transform="translate(220, 0)">
256 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMin" x="12.5" y="7.5" width="30" height="25" />
257 <use xlink:href="#hViewBox" />
258
259 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMin" x="72.5" y="7.5" width="20" height="25" />
260 <use xlink:href="#vViewBox" />
261 </g>
262 </g>
263
264 <!-- ... YMid XXX -->
265 <g transform="translate(0, 40)">
266 <g>
267 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMid meet" x="12.5" y="7.5" width="30" height="25" />
268 <use xlink:href="#hViewBox" />
269
270 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMid meet" x="72.5" y="7.5" width="20" height="25" />
271 <use xlink:href="#vViewBox" />
272 </g>
273
274 <g transform="translate(110, 0)">
275 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMid slice" x="12.5" y="7.5" width="30" height="25" />
276 <use xlink:href="#hViewBox" />
277
278 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMid slice" x="72.5" y="7.5" width="20" height="25" />
279 <use xlink:href="#vViewBox" />
280 </g>
281
282 <g transform="translate(220, 0)">
283 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMid" x="12.5" y="7.5" width="30" height="25" />
284 <use xlink:href="#hViewBox" />
285
286 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMid" x="72.5" y="7.5" width="20" height="25" />
287 <use xlink:href="#vViewBox" />
288 </g>
289 </g>
290
291 <!-- ... YMax XXX -->
292 <g transform="translate(0, 80)">
293 <g>
294 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMax meet" x="12.5" y="7.5" width="30" height="25" />
295 <use xlink:href="#hViewBox" />
296
297 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMax meet" x="72.5" y="7.5" width="20" height="25" />
298 <use xlink:href="#vViewBox" />
299 </g>
300
301 <g transform="translate(110, 0)">
302 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMax slice" x="12.5" y="7.5" width="30" height="25" />
303 <use xlink:href="#hViewBox" />
304
305 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMax slice" x="72.5" y="7.5" width="20" height="25" />
306 <use xlink:href="#vViewBox" />
307 </g>
308
309 <g transform="translate(220, 0)">
310 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMax" x="12.5" y="7.5" width="30" height="25" />
311 <use xlink:href="#hViewBox" />
312
313 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMidYMax" x="72.5" y="7.5" width="20" height="25" />
314 <use xlink:href="#vViewBox" />
315 </g>
316 </g>
317 </g>
318
319 <!-- xMaxYXXX XXX -->
320 <g transform="translate(0, 240)">
321 <!-- ... YMin XXX -->
322 <g>
323 <g>
324 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMin meet" x="12.5" y="7.5" width="30" height="25" />
325 <use xlink:href="#hViewBox" />
326
327 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMin meet" x="72.5" y="7.5" width="20" height="25" />
328 <use xlink:href="#vViewBox" />
329 </g>
330
331 <g transform="translate(110, 0)">
332 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMin slice" x="12.5" y="7.5" width="30" height="25" />
333 <use xlink:href="#hViewBox" />
334
335 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMin slice" x="72.5" y="7.5" width="20" height="25" />
336 <use xlink:href="#vViewBox" />
337 </g>
338
339 <g transform="translate(220, 0)">
340 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMin" x="12.5" y="7.5" width="30" height="25" />
341 <use xlink:href="#hViewBox" />
342
343 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMin" x="72.5" y="7.5" width="20" height="25" />
344 <use xlink:href="#vViewBox" />
345 </g>
346 </g>
347
348 <!-- ... YMid XXX -->
349 <g transform="translate(0, 40)">
350 <g>
351 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMid meet" x="12.5" y="7.5" width="30" height="25" />
352 <use xlink:href="#hViewBox" />
353
354 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMid meet" x="72.5" y="7.5" width="20" height="25" />
355 <use xlink:href="#vViewBox" />
356 </g>
357
358 <g transform="translate(110, 0)">
359 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMid slice" x="12.5" y="7.5" width="30" height="25" />
360 <use xlink:href="#hViewBox" />
361
362 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMid slice" x="72.5" y="7.5" width="20" height="25" />
363 <use xlink:href="#vViewBox" />
364 </g>
365
366 <g transform="translate(220, 0)">
367 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMid" x="12.5" y="7.5" width="30" height="25" />
368 <use xlink:href="#hViewBox" />
369
370 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMid" x="72.5" y="7.5" width="20" height="25" />
371 <use xlink:href="#vViewBox" />
372 </g>
373 </g>
374
375 <!-- ... YMax XXX -->
376 <g transform="translate(0, 80)">
377 <g>
378 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMax meet" x="12.5" y="7.5" width="30" height="25" />
379 <use xlink:href="#hViewBox" />
380
381 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMax meet" x="72.5" y="7.5" width="20" height="25" />
382 <use xlink:href="#vViewBox" />
383 </g>
384
385 <g transform="translate(110, 0)">
386 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMax slice" x="12.5" y="7.5" width="30" height="25" />
387 <use xlink:href="#hViewBox" />
388
389 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMax slice" x="72.5" y="7.5" width="20" height="25" />
390 <use xlink:href="#vViewBox" />
391 </g>
392
393 <g transform="translate(220, 0)">
394 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMax" x="12.5" y="7.5" width="30" height="25" />
395 <use xlink:href="#hViewBox" />
396
397 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="xMaxYMax" x="72.5" y="7.5" width="20" height="25" />
398 <use xlink:href="#vViewBox" />
399 </g>
400 </g>
401 </g>
402
403
404 <!-- none XXX -->
405 <g transform="translate(0,360)">
406 <g>
407 <g>
408 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="none meet" x="12.5" y="7.5" width="30" height="25" />
409 <use xlink:href="#hViewBox" />
410
411 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="none meet" x="72.5" y="7.5" width="20" height="25" />
412 <use xlink:href="#vViewBox" />
413 </g>
414
415 <g transform="translate(110, 0)">
416 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="none slice" x="12.5" y="7.5" width="30" height="25" />
417 <use xlink:href="#hViewBox" />
418
419 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="none slice" x="72.5" y="7.5" width="20" height="25" />
420 <use xlink:href="#vViewBox" />
421 </g>
422
423 <g transform="translate(220, 0)">
424 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="none" x="12.5" y="7.5" width="30" height="25" />
425 <use xlink:href="#hViewBox" />
426
427 <image xlink:href="../../resources/images/png2.png" overflow="visible" preserveAspectRatio="none" x="72.5" y="7.5" width="20" height="25" />
428 <use xlink:href="#vViewBox" />
429 </g>
430 </g>
431
432 </g>
433
434
435
436 </g>
437
438 </g><!-- "content" -->
439
440 </svg>