| 1 |
function duplicate(f,t) { |
| 2 |
var e = getE(f), g, a, p = e && e.parentNode, m; |
| 3 |
if(e) { |
| 4 |
while(p.parentNode && p.nodeName != '{$string:namespace}svg' && |
| 5 |
(p.nodeName != '{$string:namespace}g' || !p.getAttributeNS(null,'clip-path'))) { |
| 6 |
p.nodeName == '{$string:namespace}a' && (a = p); |
| 7 |
p = p.parentNode; |
| 8 |
} |
| 9 |
g = e.cloneNode(true); |
| 10 |
setattr(g,'opacity',0); |
| 11 |
e.id = t; |
| 12 |
|
| 13 |
if(a) { |
| 14 |
a = a.cloneNode(false); |
| 15 |
a.appendChild(g); |
| 16 |
g = a; |
| 17 |
} |
| 18 |
a = p.getScreenCTM(); |
| 19 |
if(a.a == 1 && a.b == 0 && a.c == 0 && |
| 20 |
a.d == 1 && a.e == 0 && a.f == 0) { |
| 21 |
a = e.getCTM(); |
| 22 |
} else { |
| 23 |
a = e.getScreenCTM().inverse().multiply(a); |
| 24 |
} |
| 25 |
setattr(g,'transform', 'matrix(' + a.a + ' ' + a.b + ' ' + a.c + ' ' + a.d + ' ' + a.e + ' ' + a.f + ')'); |
| 26 |
p.appendChild(g); |
| 27 |
} |
| 28 |
} |
| 29 |
function initDups() { |
| 30 |
for(var d in dups) |
| 31 |
duplicate(d,dups[d]); |
| 32 |
} |
| 33 |
|