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