diff --git a/src/bezier.js b/src/bezier.js index 6b12ce6..363e602 100644 --- a/src/bezier.js +++ b/src/bezier.js @@ -1998,6 +1998,14 @@ class Bezier { return `<[${this.points[0].x},${this.points[0].y}], [${this.points[1].x},${this.points[1].y}], [${this.points[2].x},${this.points[2].y}], [${this.points[3].x},${this.points[3].y}]` } + reverse() { + return new Bezier( + this.points[3].x, this.points[3].y, + this.points[2].x, this.points[2].y, + this.points[1].x, this.points[1].y, + this.points[0].x, this.points[0].y) + } + } export { Bezier };