diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index d8bc51de..f2c05df9 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -82,6 +82,28 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath# this._children[i].smooth(); }, + /** + * The first Segment contained within the path. + * + * @type Segment + * @bean + */ + getFirstSegment: function() { + var first = this.getFirstChild(); + return first && first.getFirstSegment(); + }, + + /** + * The last Segment contained within the path. + * + * @type Segment + * @bean + */ + getLastSegment: function() { + var last = this.getLastChild(); + return last && last.getLastSegment(); + }, + /** * All the curves contained within the compound-path, from all its child * {@link Path} items. @@ -96,6 +118,28 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath# return curves; }, + /** + * The first Curve contained within the path. + * + * @type Curve + * @bean + */ + getFirstCurve: function() { + var first = this.getFirstChild(); + return first && first.getFirstCurve(); + }, + + /** + * The last Curve contained within the path. + * + * @type Curve + * @bean + */ + getLastCurve: function() { + var last = this.getLastChild(); + return last && last.getFirstCurve(); + }, + contains: function(point) { point = Point.read(arguments); var count = 0;