Add convenience method to reverse a bezier curve

This commit is contained in:
Skyler Lehmkuhl 2024-12-11 15:10:57 -05:00
parent f0e1a2910f
commit c27b349668
1 changed files with 8 additions and 0 deletions

View File

@ -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}]` 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 }; export { Bezier };