mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Add #first/lastCurve getters.
This commit is contained in:
parent
306c22e00c
commit
e83195bb8f
1 changed files with 9 additions and 0 deletions
|
@ -59,6 +59,15 @@ var Path = this.Path = PathItem.extend({
|
||||||
return this._segments[this._segments.length - 1];
|
return this._segments[this._segments.length - 1];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getFirstCurve: function() {
|
||||||
|
return this.getCurves()[0];
|
||||||
|
},
|
||||||
|
|
||||||
|
getLastCurve: function() {
|
||||||
|
var curves = this.getCurves();
|
||||||
|
return curves[curves - 1];
|
||||||
|
},
|
||||||
|
|
||||||
// TODO: Consider adding getSubPath(a, b), returning a part of the current
|
// TODO: Consider adding getSubPath(a, b), returning a part of the current
|
||||||
// path, with the added benefit that b can be < a, and closed looping is
|
// path, with the added benefit that b can be < a, and closed looping is
|
||||||
// taken into account.
|
// taken into account.
|
||||||
|
|
Loading…
Reference in a new issue