Support point translations for normals defs in SvgImport.

This commit is contained in:
Jürg Lehni 2013-03-01 14:52:20 -08:00
parent 7553712e35
commit 5527ab1da8

View file

@ -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;
}, },