blob: 16a1cae23f898133154bad409693f57a72d04cc3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
SVG.Polyline = function() {
this.constructor.call(this, SVG.create('polyline'))
}
// Inherit from SVG.Shape
SVG.Polyline.prototype = new SVG.Shape
SVG.Polygon = function() {
this.constructor.call(this, SVG.create('polygon'))
}
// Inherit from SVG.Shape
SVG.Polygon.prototype = new SVG.Shape
// Add polygon-specific functions
SVG.extend(SVG.Polyline, SVG.Polygon, {
// Private: Native plot
_plot: function(p) {
if (Array.isArray(p)) {
var i, l, points = []
for (i = 0, l = p.length; i < l; i++)
points.push(p[i].join(','))
p = points.length == 0 ? points.join(' ') : '0,0'
}
return this.attr('points', p || '0,0')
}
})
|