mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Support point translations for normals defs in SvgImport.
This commit is contained in:
parent
7553712e35
commit
5527ab1da8
1 changed files with 4 additions and 3 deletions
|
@ -202,14 +202,15 @@ new function() {
|
||||||
// overflow: hidden. Paper.js currently does not suport PlacedSymbol
|
// overflow: hidden. Paper.js currently does not suport PlacedSymbol
|
||||||
// clipping, but perhaps it should?
|
// clipping, but perhaps it should?
|
||||||
var id = (getValue(node, 'href') || '').substring(1),
|
var id = (getValue(node, 'href') || '').substring(1),
|
||||||
definition = definitions[id];
|
definition = definitions[id],
|
||||||
|
point = getPoint(node, 'x', 'y');
|
||||||
// Use place if we're dealing with a symbol:
|
// Use place if we're dealing with a symbol:
|
||||||
return definition
|
return definition
|
||||||
? definition instanceof Symbol
|
? definition instanceof Symbol
|
||||||
// When placing symbols, we nee to take both point and
|
// When placing symbols, we nee to take both point and
|
||||||
// matrix into account. This just does the right thing:
|
// matrix into account. This just does the right thing:
|
||||||
? definition.place(getPoint(node, 'x', 'y'))
|
? definition.place(point)
|
||||||
: definition.clone()
|
: definition.clone().translate(point)
|
||||||
: null;
|
: null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue