mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Define failing test for cloning complex imported SVG compound paths.
Something with #clockwise goes wrong there.
This commit is contained in:
parent
d0cc8b6c16
commit
e7d9699999
2 changed files with 12 additions and 0 deletions
|
@ -335,3 +335,9 @@ function compareItems(item, item2, checkIdentity) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SVG
|
||||||
|
|
||||||
|
function createSvg(xml) {
|
||||||
|
return new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg">' + xml + '</svg>', 'application/xml');
|
||||||
|
}
|
|
@ -18,6 +18,12 @@
|
||||||
|
|
||||||
module('SvgImport');
|
module('SvgImport');
|
||||||
|
|
||||||
|
test('Import complex CompoundPath and clone', function() {
|
||||||
|
var svg = createSvg('<path id="path" fill="red" d="M4,14h20v-2H4V14z M15,26h7v-2h-7V26z M15,22h9v-2h-9V22z M15,18h9v-2h-9V18z M4,26h9V16H4V26z M28,10V6H0v22c0,0,0,4,4,4 h25c0,0,3-0.062,3-4V10H28z M4,30c-2,0-2-2-2-2V8h24v20c0,0.921,0.284,1.558,0.676,2H4z"/>;');
|
||||||
|
var item = paper.project.importSvg(svg.getElementById('path'));
|
||||||
|
compareItems(item, item.clone());
|
||||||
|
});
|
||||||
|
|
||||||
test('make an svg line', function() {
|
test('make an svg line', function() {
|
||||||
var svgns = 'http://www.w3.org/2000/svg';
|
var svgns = 'http://www.w3.org/2000/svg';
|
||||||
var shape = document.createElementNS(svgns, 'line');
|
var shape = document.createElementNS(svgns, 'line');
|
||||||
|
|
Loading…
Reference in a new issue