Fold applyAttribute() into applyAttributes().

This commit is contained in:
Jürg Lehni 2013-03-01 10:31:42 -08:00
parent 417cfde795
commit 6571c28256

View file

@ -392,24 +392,6 @@ new function() {
}
});
/**
* Parses an SVG style attibute and applies it to a Paper.js item.
*
* @param {SVGSVGElement} node an SVG node
* @param {Item} item the item to apply the style or attribute to.
* @param {String} name an SVG style name
* @param value the value of the SVG style
*/
function applyAttribute(item, value, name, node) {
var attribute;
if (value != null && (attribute = attributes[name])) {
var res = attribute(item, value, name, node);
if (res !== undefined)
item = res;
}
return item;
}
/**
* Converts various SVG styles and attributes into Paper.js styles and
* attributes and applies them to the passed item.
@ -438,7 +420,7 @@ new function() {
value = null;
}
if (value)
item = applyAttribute(item, value, key, node);
item = Base.pick(apply(item, value, key, node), item);
});
return item;
}