1
0
Fork 0

Further changes to handling of parts and copying their data

This commit is contained in:
Joost De Cock 2018-08-05 15:52:37 +02:00
parent 415a98f68e
commit fd80450d77
6 changed files with 30 additions and 44 deletions

View file

@ -40,8 +40,9 @@ path.prototype.close = function() {
};
/** Adds an attribute. This is here to make this call chainable in assignment */
path.prototype.attr = function(name, value) {
this.attributes.add(name, value);
path.prototype.attr = function(name, value, overwrite = false) {
if (overwrite) this.attributes.set(name, value);
else this.attributes.add(name, value);
return this;
};