Add convenience method to reverse a bezier curve
This commit is contained in:
parent
f0e1a2910f
commit
c27b349668
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Reference in New Issue