blob: 1a32a00f83d7bef90f2c3c60f4579879a89ed279 (
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
32
33
34
35
36
37
38
39
40
|
SVG.Shape = function Shape(element) {
this.constructor.call(this, element);
};
// inherit from SVG.Element
SVG.Shape.prototype = new SVG.Element();
// Add shape-specific functions
SVG.Utils.merge(SVG.Shape, {
// set fill color and opacity
fill: function(f) {
if (f.color != null)
this.attr('fill', f.color);
if (f.opacity != null)
this.attr('fill-opacity', f.opacity);
return this;
},
// set stroke color and opacity
stroke: function(s) {
if (s.color)
this.attr('stroke', s.color);
if (s.width != null)
this.attr('stroke-width', s.width);
if (s.opacity != null)
this.attr('stroke-opacity', s.opacity);
if (this.attrs['fill-opacity'] == null)
this.fill({ opacity: 0 });
return this;
}
});
|