1
0
Fork 0

🚧 Part cloning

This commit is contained in:
Joost De Cock 2018-08-03 14:20:28 +02:00
parent 9a60dc5756
commit 18cc30fe74
7 changed files with 90 additions and 3 deletions

View file

@ -108,4 +108,12 @@ point.prototype.shiftOutwards = function(that, distance) {
return this.shiftTowards(that, this.dist(that) + distance);
};
/** Returns a deep copy of this */
point.prototype.clone = function() {
let clone = new point(this.x, this.y);
clone.attributes = this.attributes.clone();
return clone;
};
export default point;