mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
SVG nodeNames are case sensitive.
This commit is contained in:
parent
f1fe2575a8
commit
835ca80eff
2 changed files with 8 additions and 8 deletions
|
@ -458,7 +458,7 @@ new function() {
|
|||
// We can only use node nodes as defintion containers. Have the loop
|
||||
// produce one if it's a single item of another type (when calling
|
||||
// #exportSvg() on an item rather than a whole project)
|
||||
var container = node.nodeName.toLowerCase() == 'svg' && node,
|
||||
var container = node.nodeName == 'svg' && node,
|
||||
firstChild = container ? container.firstChild : node;
|
||||
for (var i in definitions.svgs) {
|
||||
if (!container) {
|
||||
|
|
|
@ -68,7 +68,7 @@ new function() {
|
|||
|
||||
function importGroup(node, type) {
|
||||
var nodes = node.childNodes,
|
||||
compound = type === 'clippath',
|
||||
compound = type === 'clipPath',
|
||||
group = compound ? new CompoundPath() : new Group(),
|
||||
project = group._project,
|
||||
currentStyle = project._currentStyle;
|
||||
|
@ -97,7 +97,7 @@ new function() {
|
|||
}
|
||||
// Restore currentStyle
|
||||
project._currentStyle = currentStyle;
|
||||
if (/^(defs|clippath)$/.test(type)) {
|
||||
if (/^(defs|clipPath)$/.test(type)) {
|
||||
// I don't think we need to add defs to the DOM. But we might want
|
||||
// to use Symbols for them?
|
||||
group.remove();
|
||||
|
@ -137,7 +137,7 @@ new function() {
|
|||
stops.push(applyAttributes(new GradientStop(), child));
|
||||
}
|
||||
var gradient = new Gradient(stops),
|
||||
isRadial = type == 'radialgradient',
|
||||
isRadial = type === 'radialGradient',
|
||||
origin, destination, highlight;
|
||||
if (isRadial) {
|
||||
gradient.type = 'radial';
|
||||
|
@ -160,7 +160,7 @@ new function() {
|
|||
g: importGroup,
|
||||
// http://www.w3.org/TR/SVG/struct.html#NewDocument
|
||||
svg: importGroup,
|
||||
clippath: importGroup,
|
||||
clipPath: importGroup,
|
||||
// http://www.w3.org/TR/SVG/shapes.html#PolygonElement
|
||||
polygon: importPoly,
|
||||
// http://www.w3.org/TR/SVG/shapes.html#PolylineElement
|
||||
|
@ -168,9 +168,9 @@ new function() {
|
|||
// http://www.w3.org/TR/SVG/paths.html
|
||||
path: importPath,
|
||||
// http://www.w3.org/TR/SVG/pservers.html#LinearGradients
|
||||
lineargradient: importGradient,
|
||||
linearGradient: importGradient,
|
||||
// http://www.w3.org/TR/SVG/pservers.html#RadialGradients
|
||||
radialgradient: importGradient,
|
||||
radialGradient: importGradient,
|
||||
|
||||
// http://www.w3.org/TR/SVG/struct.html#ImageElement
|
||||
image: function (node) {
|
||||
|
@ -457,7 +457,7 @@ new function() {
|
|||
}
|
||||
|
||||
function importSvg(node, clearDefs) {
|
||||
var type = node.nodeName.toLowerCase(),
|
||||
var type = node.nodeName,
|
||||
importer = importers[type],
|
||||
item = importer && importer(node, type);
|
||||
// See importGroup() for an explanation of this filtering:
|
||||
|
|
Loading…
Reference in a new issue