summaryrefslogtreecommitdiffstats
path: root/src/line.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-03-24 20:25:27 +0100
committerwout <wout@impinc.co.uk>2013-03-24 20:25:27 +0100
commita0076d75bbac8f2c128f9b34e976bcb1ea3caa09 (patch)
tree381e86815fb236a01d607017c01050d42264952a /src/line.js
parent20e9f674cb11d0f856baf7e05517cbebda31fdb8 (diff)
downloadsvg.js-a0076d75bbac8f2c128f9b34e976bcb1ea3caa09.tar.gz
svg.js-a0076d75bbac8f2c128f9b34e976bcb1ea3caa09.zip
Added plot() method to SVG.Line
Diffstat (limited to 'src/line.js')
-rw-r--r--src/line.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/line.js b/src/line.js
index 893fe62..b32141c 100644
--- a/src/line.js
+++ b/src/line.js
@@ -43,5 +43,14 @@ SVG.extend(SVG.Line, {
.attr(this.attr('x1') < this.attr('x2') ? 'x2' : 'x1', b.x + width)
.attr(this.attr('y1') < this.attr('y2') ? 'y2' : 'y1', b.y + height)
}
+ // Set path data
+, plot: function(x1, y1, x2, y2) {
+ return this.attr({
+ x1: x1
+ , y1: y1
+ , x2: x2
+ , y2: y2
+ })
+ }
})