From 8d5024523c2484719cc5579c8c22ca35f2191c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 4 Mar 2011 23:33:37 +0000 Subject: [PATCH] Add Path#first/lastSegment. --- src/path/Path.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/path/Path.js b/src/path/Path.js index e4d0092b..476b7c00 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -33,6 +33,16 @@ var Path = this.Path = PathItem.extend({ } }, + // TODO: Add back to Scriptographer: + + getFirstSegment: function() { + return this._segments[0]; + }, + + getLastSegment: function() { + return this._segments[this._segments.length - 1]; + }, + // 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 // taken into account.