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

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